Przejdź do treści
Biblioteka skilli
DevOps i chmura · Automatyzacja

repo-sync

/repo-sync

Utrzymuje aktualne lokalne kopie repozytoriów, klonując brakujące i aktualizując resztę bez zmian w GitHubie.

Repozytorium
repoman ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
12.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 12.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Utrzymuje aktualne lokalne kopie repozytoriów, klonując brakujące i aktualizując resztę bez zmian w GitHubie.

Oryginalny opis (EN)

Keep local clones of the enrolled repos current by cloning missing ones and fast-forward pulling the rest, read-only toward GitHub. Use when the local working copies that the scanner, fixer, and report programs read need to be up to date, or when the daily repo-sync cron job runs.

Jak działa

  1. Prerequisites
  2. Before Running
  3. Running Repo Sync
  4. Interpreting Output
  5. Safety
Sekcje z nagłówków SKILL.md, w oryginale · 83 linii, 636 słów
Podgląd SKILL.md
---
name: repo-sync
description: >-
  Keep local clones of the enrolled repos current by cloning missing ones
  and fast-forward pulling the rest, read-only toward GitHub. Use when the
  local working copies that the scanner, fixer, and report programs read
  need to be up to date, or when the daily repo-sync cron job runs.
license: Complete terms in LICENSE.txt
---

# Repo Sync

Keep local clones of the enrolled repos current so the scanner, fixer, and report programs operate on up-to-date working copies. The script only clones and fast-forward pulls. It never pushes, opens PRs, resets, or deletes.

**Run scripts with `--help` first** to see full usage and options. The script lives in the automation repo, not in this repo, so run it from an automation checkout.

## Prerequisites

- `bash` 3.2+ (the macOS system default works; the script avoids bash 4 features)
- `git`
- `jq` (the config and enrolled-set readers parse JSON with it)
- repoman config at `~/.repoman/config.json` (see Before Running for the keys)
- a readable `~/.repoman/repos.json` (the enrolled set)

### Requirements (machine-readable)

- pat_scopes: []
- labels_required: []
- labels_applied: []
- programs: [repo-sync]

## Before Running

### 1. Confirm the config

The repoman config lives at `~/.repoman/config.json`. Repo-sync reads `REPOS_DIR` from it (the root under which clones are namespaced), and repoman validates two required keys — `repos_dir` and `fork_owner` — even though repo-sync itself only uses `repos_dir`. A missing config or an empty required key fails the run loud.

```bash
cat ~/.repoman/config.json   # expects at least {"repos_dir": "...", "fork_owner": "..."}
```

The config and enrolled-set paths can be overridden for testing with the `REPOMAN_CONFIG_FILE` and `REPOMAN_REPOS_FILE` environment variables; unset, they default to `~/.repoman/config.json` and `~/.repoman/repos.json`.

### 2. Confirm the enrolled set

The source of truth is `~/.repoman/repos.json`, the enrolled repos. This is not `gh repo list <org>`, and there is no `$ORG` fallback. If the enrolled-repos file is missing, empty, or malformed JSON, the run fails loud — an unreadable enrolled set is never silently treated as "no repos."

```bash
cat ~/.repoman/repos.json
```

Each enrolled `owner/name` is cloned into `<REPOS_DIR>/<owner>/<name>/` (owner-namespaced) if missing, or fast-forward pulled if the clone already exists. An entry whose owner or name is not a single safe path segment (`[A-Za-z0-9._-]`, never `.`, `..`, or a slash) is rejected before any clone, so a crafted `repos.json` cannot escape the clone tree.

### 3. (optional) Confirm the agent-skills clone for the skills refresh

The skills refresh runs when you pass `--refresh-skills` **or** when `REPOMAN_SKILLS_DIR` is set (either trigger alone opts in; the flag wins if both are given). `REPOMAN_SKILLS_DIR` selects the clone path and defaults to `~/agent-skills`. Confirm that clone exists first — the refresh fast-forward pulls an existing clone and does not create one.

## Running Repo Sync

Plain run, from an automation checkout:

```bash
bash scripts/repo-sync.sh
```

With the optional skills refresh, which also fast-forward pulls the local agent-skills clone after syncing repos:

```bash
bash scripts/repo-sync.sh --refresh-skills
```

`--help` prints usage and exits 0. An unknown argument exits 2.

## Interpreting Output

The run ends with a summary line:

```
repo-sync: pulled N cloned N failed N
```

When any repo failed, a `failed repos:` list follows, naming each failed repo with the reason — a clone/pull entry carries git's one-line error; an entry rejected up front is labeled `invalid owner/name` or `mkdir failed`.

## Safety

- Read-only toward GitHub: clones and fast-forward pulls only, never pushes, opens PRs, resets, or deletes.
- Per-repo failures (clone, pull, directory creation, or an invalid owner/name) are logged and non-fatal; the run continues with the rest of the enrolled repos. As long as at least one repo succeeds, a partial sync still exits 0.
- Reading repoman config and the enrolled-repos file are prerequisites; if either fails, the whole run aborts non-zero.
- With `--refresh-skills`, a missing skills clone is a fatal error (non-zero exit); repo-sync does not bootstrap it.
- The run exits non-zero when a prerequisite read fails, when **every** enrolled repo fails (a total failure must not report success), or when a requested skills refresh fails. A *partial* per-repo failure does not change the exit code.
- Runs daily via a cron job named `repo-sync`.

Wersje

RepozytoriumWynikLicencja
Ta strona · rossoctl/repoman100Apache-2.0
davidondrej/skills100MIT

Migawka bazy z 13.11.2026 · wersja paczki 3a0ce1f46ca6 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 91ensure-repo-sync
    Sprawdza lub synchronizuje wskazane lokalne repozytoria, gdy użytkownik wyraźnie o to prosi.
  • 100fleet
    Zarządza rejestrem lokalnych repozytoriów i pokazuje panel kondycji wszystkich repo tylko do odczytu, w tym dryf konfiguracji i dodawanie repozytoriów do rejestru.
  • 100ghreport
    Tworzy raport tylko do odczytu o stanie repozytoriów organizacji GitHub: otwarte PR-y, CI na gałęzi domyślnej, alerty bezpieczeństwa i ochrona gałęzi, w podsumowaniu terminalowym i pliku markdown.
  • 100github-multi-repo
    Koordynuje wiele repozytoriów GitHub: synchronizacja, zarządzanie architekturą i planowanie zależności, gdy zmiany obejmują kilka repozytoriów.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.