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
42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
name: fork-sync
|
|
on:
|
|
schedule:
|
|
- cron: '0 * * * *'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: setup git
|
|
run: |
|
|
git config --global user.name "fork-sync[bot]"
|
|
git config --global user.email "hermes@rudenk.local"
|
|
git config --global advice.detachedHead false
|
|
|
|
- name: setup python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: sync forks
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.HERMES_GITEA_TOKEN }}
|
|
WORK_ROOT: ${{ github.workspace }}/work
|
|
run: |
|
|
set +e
|
|
python tools/fork-sync.py > out.txt 2>&1
|
|
rc=$?
|
|
set -e
|
|
echo "::group::fork-sync output"
|
|
cat out.txt
|
|
echo "::endgroup::"
|
|
echo "fork-sync rc=$rc"
|
|
if [ $rc -ne 0 ] && [ $rc -ne 2 ]; then
|
|
echo "::error::fork-sync failed with rc=$rc"
|
|
exit $rc
|
|
fi
|