hermes ae400c416e feat(fork-sync): discover forks dynamically via Gitea API
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
2026-09-14 20:12:48 +00:00

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>:

  1. Clones the fork if not present
  2. Adds <upstream-owner>/<name> as upstream remote
  3. Fetches both upstream and origin with --prune
  4. Fast-forwards every local branch with an upstream counterpart (only --ff-only)
  5. Creates local tracking branches for upstream branches we don't have yet
  6. Reports divergences (non-FF-able conflicts) on stdout

Stdout is empty on quiet tick. Non-empty stdout = one Telegram alert.

Trigger

  • Schedule: hourly (0 * * * *) — workflow fork-sync.yml
  • Manual: workflow_dispatch
  • Local cron (fallback for environments without actions): /opt/data/cron/jobs.json → job fork-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 definition
  • tools/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.

S
Description
Hermes-agent cron-driven fork-sync infrastructure. Workflow syncs upstream branches into hermes/* forks hourly.
Readme
65 KiB
Languages
Python 100%