Skip to content

Retry gh api on transient failures in classify-pr action#108

Merged
mtfishman merged 1 commit intomainfrom
mf/classify-pr-retry
May 6, 2026
Merged

Retry gh api on transient failures in classify-pr action#108
mtfishman merged 1 commit intomainfrom
mf/classify-pr-retry

Conversation

@mtfishman
Copy link
Copy Markdown
Member

Summary

  • Add a short retry loop (3 attempts with 2s/4s exponential backoff) around the gh api call in .github/actions/classify-pr/action.yml.
  • GitHub's API occasionally returns a 5xx HTML error page, which causes gh api --jq to exit non-zero with a JSON parse error like invalid character '<' looking for beginning of value. Without retry, that single transient flake flunks the entire matrix leg.
  • Observed today on a 3-line workflow-only patch PR: a Windows-LTS leg failed in classify-pr because the API call hit a 5xx, while every other leg passed. Re-running the failed job alone made it green.

GitHub's API occasionally returns a 5xx HTML error page, which causes
gh api --jq to exit non-zero with a JSON parse error like
'invalid character \'<\' looking for beginning of value'. Add a short
retry loop with exponential backoff (3 attempts, 2s/4s) so transient
flakes don't flunk the run.
@mtfishman mtfishman merged commit a4d5e21 into main May 6, 2026
3 checks passed
@mtfishman mtfishman deleted the mf/classify-pr-retry branch May 6, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant