fix: Treat 429 (cycle already running) as success in workflows

When MAX_CONCURRENT=1 and a cycle is in progress, the trigger server
returns 429. This is expected behavior, not an error — the previous
curl -f treated it as failure (exit code 22).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
B 2026-02-10 03:43:32 +00:00
parent 5db68ea8d8
commit 6b5a547e2d
2 changed files with 24 additions and 4 deletions

View file

@ -20,5 +20,15 @@ jobs:
SPRITE_URL: ${{ secrets.DISCOVERY_SPRITE_URL }}
TRIGGER_SECRET: ${{ secrets.DISCOVERY_TRIGGER_SECRET }}
run: |
curl -sf -X POST "${SPRITE_URL}/trigger?reason=${{ github.event_name }}" \
-H "Authorization: Bearer ${TRIGGER_SECRET}"
HTTP_CODE=$(curl -s -o /tmp/response.json -w '%{http_code}' -X POST \
"${SPRITE_URL}/trigger?reason=${{ github.event_name }}" \
-H "Authorization: Bearer ${TRIGGER_SECRET}")
cat /tmp/response.json
if [ "$HTTP_CODE" = "429" ]; then
echo "Cycle already running, skipping"
elif [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
echo "Triggered successfully"
else
echo "Failed with HTTP $HTTP_CODE"
exit 1
fi

View file

@ -20,5 +20,15 @@ jobs:
SPRITE_URL: ${{ secrets.REFACTOR_SPRITE_URL }}
TRIGGER_SECRET: ${{ secrets.REFACTOR_TRIGGER_SECRET }}
run: |
curl -sf -X POST "${SPRITE_URL}/trigger?reason=${{ github.event_name }}&issue=${{ github.event.issue.number || '' }}" \
-H "Authorization: Bearer ${TRIGGER_SECRET}"
HTTP_CODE=$(curl -s -o /tmp/response.json -w '%{http_code}' -X POST \
"${SPRITE_URL}/trigger?reason=${{ github.event_name }}&issue=${{ github.event.issue.number || '' }}" \
-H "Authorization: Bearer ${TRIGGER_SECRET}")
cat /tmp/response.json
if [ "$HTTP_CODE" = "429" ]; then
echo "Cycle already running, skipping"
elif [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
echo "Triggered successfully"
else
echo "Failed with HTTP $HTTP_CODE"
exit 1
fi