Removes the hardcoded FORK_PAIRS list. The workflow now calls
GET /api/v1/users/{user}/repos and walks every repo where
`fork=true`, using `parent.full_name` as the upstream.
Behaviour:
- FORK_PAIRS env still works as an explicit override (used by tests).
- New forks owned by hermes are picked up automatically without any
config change.
- Repos whose parent is not accessible (private, deleted, ACL change)
are skipped with a single ::note:: log line.
- All other behaviour unchanged: clones, FF, branch creation, push.
Tested locally against the live Gitea: discovered 5 forks
(brencher, ansible, reverseproxy, mcps, hermes-voice-gateway) and
synced them as expected.
Assisted-By: hermes-agent:minimax-m3
The previous version only updated local clones (the CI workdir) but
never pushed the synced state back to the fork. This means the Gitea
web UI kept showing stale branches even after a green CI run.
Now `git push origin <branch>` runs after each successful fast-forward
and after each created branch. The local CI run can then verify via
the Gitea API that the fork actually moved.
Note: forks whose default_branch differs from upstream default_branch
(e.g. hermes/hermes-voice-gateway uses feat/voice-gateway-mvp while
upstream Org1/hermes-voice-gateway uses main) will still lag on the
default branch. To keep both in sync, run the workflow with a
FORK_BRANCHES env that includes the upstream default_branch name.
Assisted-By: hermes-agent:minimax-m3
fork-sync.py exits with code 2 when it has alerts to report (changes
detected) and 1 on real errors. The workflow was treating any non-empty
output as a failure, which made every run where branches were created
show up as failure in CI even though everything worked correctly.
Workflow now distinguishes:
rc=0: nothing to report
rc=2: changes reported (success, but worth surfacing in CI summary)
rc>=3 or other: real failure, mark as such
Assisted-By: hermes-agent:minimax-m3
`git remote remove upstream` exits non-zero when the remote does not exist,
which then blocks `git remote add upstream` from succeeding. The first-run
CI clones failed on a non-empty error stream even though the second
attempt would have succeeded.
Fix: only `git remote add` when the previous `remove` actually removed
something (returncode 0). When the remote was already absent, skip the
add since fetch will set it up implicitly. This makes the first-run
clone idempotent.
Assisted-By: hermes-agent:minimax-m3