ci: retry gh auth login to survive transient GitHub API 5xx - #52
Draft
Sbussiso wants to merge 1 commit into
Draft
Conversation
The Auth GitHub CLI step calls the GitHub API to validate the token,
which failed in run #576 with a transient HTTP 503 ('No server is
currently available') during a GitHub-side degradation. This killed
the entire hourly docs sync even though the token and script were fine.
Wrap gh auth login in a bounded retry loop (5 attempts, linear backoff)
so a momentary GitHub API blip no longer fails the run.
Fixes SourceBox-LLC/sentinel-website run 32042892282.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause — run #576 (32042892282)
The Sync Docs workflow failed at the
Auth GitHub CLIstep:This is a transient GitHub-side API degradation (HTTP 503 on the GraphQL endpoint), not a token, script, or repo problem.
gh auth logincalls the GitHub API to validate the token, and that validation call was rejected because GitHub itself was briefly unavailable. The hourly cron run was killed entirely by this one momentary blip — confirmed by the fact that my owngh repo cloneof this repo hit the identical 503 and needed a retry to succeed.Fix
Wrap
gh auth loginin a bounded retry loop (5 attempts, linear backoff of 5/10/15/20/25s) so a momentary GitHub API 5xx no longer fails the whole sync. The token is unchanged; we just tolerate GitHub being briefly flaky.Why a draft
Opened as a draft so a human can sanity-check before the hourly cron picks it up. If you would rather just re-run the failed job (it self-heals next cron), no PR is needed — but this hardens the workflow against the next 503.
Triage ref: run 32042892282, commit 196bf4b.