fix(workflow): treat fork-sync rc=2 as success-with-changes
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
This commit is contained in:
@@ -27,11 +27,15 @@ jobs:
|
||||
GITEA_TOKEN: ${{ secrets.HERMES_GITEA_TOKEN }}
|
||||
WORK_ROOT: ${{ github.workspace }}/work
|
||||
run: |
|
||||
python tools/fork-sync.py > out.txt 2>&1 || true
|
||||
set +e
|
||||
python tools/fork-sync.py > out.txt 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
echo "::group::fork-sync output"
|
||||
cat out.txt
|
||||
if [ -s out.txt ]; then
|
||||
echo "::group::fork-sync output"
|
||||
cat out.txt
|
||||
echo "::endgroup::"
|
||||
exit 1
|
||||
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
|
||||
|
||||
@@ -176,6 +176,7 @@ def main():
|
||||
if not alerts:
|
||||
return
|
||||
print("\n".join(alerts))
|
||||
sys.exit(2) # 2 = changes reported, distinct from 1 = real error
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user