Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/ci-auto-healer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,16 @@ jobs:
continue
fi

# Limit number of reruns to prevent infinite loops
# Skip runs that have already exceeded the global retry budget across all
# healer invocations. run_attempt==1 is the original run; each rerun
# increments it, so run_attempt==4 means 3 reruns have already been done.
ATTEMPT=$(gh api /repos/$REPO/actions/runs/$RUN_ID --jq '.run_attempt' 2>/dev/null || echo "1")
if [ "${ATTEMPT:-1}" -ge "$MAX_RERUNS" ] 2>/dev/null; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow the third configured rerun

When a run has already failed after two healer-triggered reruns, GitHub reports run_attempt as 3 because the original run is attempt 1 (the new comment also notes attempt 4 means three reruns). This -ge "$MAX_RERUNS" check therefore skips the run at attempt 3, so MAX_RERUNS=3 and the later “after 3 reruns” messaging only ever allow two automatic reruns; compare against MAX_RERUNS + 1 or track actual rerun count instead.

Useful? React with 👍 / 👎.

echo "Run $RUN_ID already at attempt $ATTEMPT/$MAX_RERUNS — skipping, needs manual review"
continue
fi

# Limit number of reruns per healer invocation to avoid hammering CI
if [ $RERUN_COUNT -ge $MAX_RERUNS ]; then
echo "Reached maximum reruns ($MAX_RERUNS), stopping"
break
Expand Down
Loading