Switch e2e CI jobs to workload identity federation#1018
Merged
Conversation
The e2e, Docker, and example jobs in test.yml authenticated with the ANTHROPIC_API_KEY secret, which is no longer valid, so every push to main fails and blocks the auto-release workflow. Authenticate via workload identity federation instead: a local composite action mints the workflow's GitHub OIDC token, writes it to a file for the CLI to exchange, and refreshes it in the background since the e2e jobs run longer than the token stays valid.
ant-kurt
approved these changes
Jun 2, 2026
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.
What
test-e2e,test-e2e-docker, andtest-examplesjobs intest.ymlstill authenticated with theANTHROPIC_API_KEYsecret, which is no longer valid — every push tomainhas failed since May 23 (e.g. this run), which blocks the auto-release workflow and has kept the published SDK pinned to bundled CLI 2.1.150. Fixes CI failing, no new package updates, bundled cli stuck to 2.1.150, so no Opus 4.8 #1003.claude.yml/claude-code-review.yml/claude-issue-triage.ymlworkflows already do. The SDK inherits the federation env vars (ANTHROPIC_FEDERATION_RULE_ID,ANTHROPIC_ORGANIZATION_ID,ANTHROPIC_SERVICE_ACCOUNT_ID,ANTHROPIC_IDENTITY_TOKEN_FILE) into the CLI subprocess, and the CLI exchanges the OIDC token for a short-lived access token.claude-code-action, a new local composite action (.github/actions/setup-claude-auth) mints the workflow's GitHub OIDC token, writes it to a file, and exportsANTHROPIC_IDENTITY_TOKEN_FILE. The e2e jobs run 7–10 minutes — longer than a GitHub OIDC token stays valid — so the action also leaves behind a detached refresher process that rewrites the file every 4 minutes (the same refresh approachclaude-code-actionuses internally).id-token: write. The existing fork-PR skip conditions are unchanged in effect: fork PRs couldn't read the secret before and can't mint OIDC tokens now.Testing