9f6ef132f8314a6c92d4d213aca7e8d79e51e344
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
hermes/fork-sync
Sync infrastructure for hermes/* forks. Workflow pulls upstream branches
into forks every hour.
What it does
For each fork pair hermes/<name>=<upstream-owner>/<name>:
- Clones the fork if not present
- Adds
<upstream-owner>/<name>asupstreamremote - Fetches both
upstreamandoriginwith--prune - Fast-forwards every local branch with an upstream counterpart (only
--ff-only) - Creates local tracking branches for upstream branches we don't have yet
- Reports divergences (non-FF-able conflicts) on stdout
Stdout is empty on quiet tick. Non-empty stdout = one Telegram alert.
Trigger
- Schedule: hourly (
0 * * * *) — workflowfork-sync.yml - Manual:
workflow_dispatch - Local cron (fallback for environments without actions):
/opt/data/cron/jobs.json→ jobfork-sync(every 1h)
Fork pairs (default)
hermes/brencher = admin/brencher
hermes/ansible = admin/ansible
hermes/reverseproxy = admin/reverseproxy
hermes/mcps = admin/mcps
hermes/hermes-voice-gateway = Org1/hermes-voice-gateway
Override via FORK_PAIRS env (comma-separated fork=upstream).
Secrets
| Name | Required | Used for |
|---|---|---|
HERMES_GITEA_TOKEN |
yes | clone + fetch over HTTPS |
Names starting with GITEA_ or GITHUB_ are reserved by Gitea, hence the HERMES_ prefix.
Files
.gitea/workflows/fork-sync.yml— workflow definitiontools/fork-sync.py— sync script (shared with local cron fallback)
Adding a new fork
Append hermes/<repo>=<upstream-owner>/<repo> to FORK_PAIRS. The next run
will clone the fork and pull every upstream branch.
Description
Hermes-agent cron-driven fork-sync infrastructure. Workflow syncs upstream branches into hermes/* forks hourly.
65 KiB
Languages
Python
100%