Skip to content

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

Merged
gregberge merged 2 commits into
mainfrom
claude/pr-416-review-simplify-437294
Nov 12, 2026
Merged

gregberge merged 2 commits into
mainfrom
claude/pr-416-review-simplify-437294

Conversation

@gregberge

Copy link
Copy Markdown
Member

Description

Takes over #416 by @kasperg from a branch in this repository so it can be merged. Their commit is kept as is, with a small cleanup on top.

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

fetchOidcToken now retries a 5xx (and a network failure) 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. A 4xx is still reported at once, since a retry would not change it. The following exchange with the Argos API already goes through apiFetch, so this GET was the only request in the OIDC flow without retries.

The second commit throws a p-retry AbortError for a 4xx inside the retried call, so the error is built in one place, and counts the mocked requests in the tests with a vi.fn handler.

Type of changes

bug

Checklist

Optional checks:

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

🤖 Generated with Claude Code

kasperg and others added 2 commits November 11, 2026 10:33
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>
Throw a p-retry AbortError for a 4xx inside the retried call, so the
error message is built once and the non-ok check is not repeated after
the retry. Count the mocked token requests with a vi.fn handler, and
say in the comment that network failures are retried too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gregberge
gregberge merged commit 9d91d71 into main Nov 12, 2026
77 checks passed
@gregberge
gregberge deleted the claude/pr-416-review-simplify-437294 branch November 12, 2026 12:01
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