Skip to content

fix(core): retry the GitHub Actions OIDC token request on 5xx - #416

Closed
kasperg wants to merge 1 commit into
argos-ci:mainfrom
kasperg:fix/retry-github-oidc-token
Closed

kasperg wants to merge 1 commit into
argos-ci:mainfrom
kasperg:fix/retry-github-oidc-token

Conversation

@kasperg

@kasperg kasperg commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

An upload authenticated with GitHub Actions OIDC fails if GitHub's token service answers a single request with a server error. We hit this on a push to main: the tests passed, then the upload stopped with Failed to fetch GitHub Actions OIDC token: 503. GitHub reported no incident at the time, and a pull request build uploading at the same time got its token.

fetchOidcToken now retries a 5xx response three times with p-retry's default backoff (1, 2 and 4 seconds), as apiFetch does for Argos's own API. GitHub's @actions/core also retries 502, 503 and 504 from this endpoint (oidc-utils.ts). A 4xx is still reported at once, since a retry would not change it.

Type of changes

bug

Checklist

Optional checks:

  • My changes requires a change to the documentation
  • I have updated the documentation accordingly

Further comments

@actions/core retries up to 10 times, but from 10 ms doubling to a 5.12 s cap, which waits about 10 s in all. Three retries from 1 s follow apiFetch and wait 7 s in all, so both give up within seconds of each other. retries: 10, minTimeout: 10, maxTimeout: 5120 would match @actions/core exactly, if you prefer that.

A failed build on the default branch hurts more than a failed pull request build: that commit gets no baseline, so the branches cut from it are compared with an older commit and report changes they did not make.

The OIDC token is fetched with a single request, so one 5xx from
GitHub's token service fails the whole upload after the screenshots
are taken. We saw a 503 on a push to the default branch while GitHub
reported no incident and a concurrent build got its token.

Retry a 5xx three times with p-retry's default backoff, as apiFetch
does for the Argos API. GitHub's @actions/core retries 502, 503 and
504 from this endpoint too. A 4xx still fails at once, since a retry
would not change it.

Assisted-by: Claude <noreply@anthropic.com>
@kasperg
kasperg force-pushed the fix/retry-github-oidc-token branch from 9954482 to 35cff05 Compare November 11, 2026 09:35
@kasperg
kasperg marked this pull request as ready for review November 11, 2026 09:38
@gregberge

Copy link
Copy Markdown
Member

Thanks @kasperg! Continuing in #417 from a branch in this repository so we can merge it. Your commit is kept as is, with a small cleanup on top.

@gregberge gregberge closed this Nov 12, 2026
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.

2 participants