Repository navigation
ci(frontend-deploy): Authenticate Vercel deploys with OIDC - #9220
matthewelwell wants to merge 4 commits into
Conversation
The deploy step authenticated with VERCEL_TOKEN, a personal access token that acts as the user who minted it. Enforcing 2FA on the Vercel team made every call made with a token whose owner had not enrolled fail with "You must set up Two-Factor Authentication before accessing this team", taking out the production and demo deploys while demo2 — holding a different user's token — carried on. Exchange the job's GitHub OIDC token for a short-lived Vercel access token instead, so no deploy depends on an individual's account state. The Vercel CLI built-in app is cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp; the team's OIDC policies pin the issuer, audience, repository, project and allowed command. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Vercel ship OIDC login actions for the Container Registry and Turborepo, but none for CLI deploys, so the exchange has to be done inline. Doing it in github-script rather than shell drops the hand-built OIDC request URL and both jq parses, and reports a failed exchange with the status and body instead of a bare curl exit code. v9 runs on Node 24, so this job stops emitting the Node 20 deprecation warning as well. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
Turn on auto-fix | Re-trigger cubic
✅ private-cloud · depot-ubuntu-latest-16 — run #24067 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-arm-16 — run #24067 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #24067 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #24067 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #24066 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #24066 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-16 — run #24066 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #24066 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
|
Visual Regression31 screenshots compared. See report for details. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9220 +/- ##
==========================================
+ Coverage 98.10% 98.96% +0.85%
==========================================
Files 1724 1724
Lines 73823 73879 +56
==========================================
+ Hits 72425 73113 +688
+ Misses 1398 766 -632 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The exchange was inline in the deploy job, first as shell and then as an embedded script, leaving the workflow carrying auth plumbing either way. Put it in .github/actions/vercel-login alongside codeartifact-login, which solves the same problem for CodeArtifact, so the deploy job reads as one step and the plumbing is swapped out in one line once Vercel ship a login action for CLI deploys. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
npm ci runs dependency install scripts, so a step-level VERCEL_TOKEN put the deploy credential in reach of any package's postinstall and of the bundle itself. Split the build from the deploy so only `vercel --prod` sees it, and mint it after the build so a failed bundle does not exchange a token at all. Reported by cubic. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Warning
Blocked: the
vercel-cliOIDC app is not enabled for our Vercel team. Team settings offer only VCR and Turborepo CLI policies, andPOST /v1/oidc-policiesreturns 403. Without a policy the exchange yields no token and every frontend deploy fails, so this must not merge until Vercel enable the app for us.A Vercel access token acts as the user who minted it, so enforcing 2FA on the team gated every call made with a token whose owner had not enrolled. Production and demo share one person's token and both failed with
You must set up Two-Factor Authentication before accessing this team; demo2 holds another's and kept deploying.These three projects deploy from CI rather than through Vercel's Git integration so the E2E suite can gate them, which is what Vercel recommend:
So a bearer token is unavoidable — make it a short-lived one. The job now exchanges its GitHub OIDC token for a Vercel access token in a new
.github/actions/vercel-login, alongsidecodeartifact-login. Vercel have no login action for CLI deploys yet, so the exchange lives there and swaps out in one line when they ship one.This needs an OIDC policy on the team first, or the exchange matches nothing. One policy for all three projects, so no exchange is ambiguous:
vercel oidc-policiesis hidden and undocumented, and needs CLI 68.x. The threeVERCEL_TOKENsecrets can be deleted once this lands.How did you test this code?
The deploy workflow only runs on push to
main, so not from this PR.Ran the action's exchange step verbatim against the live API: a bad subject token surfaces Vercel's reason as an error annotation and exits 1, and a well-formed response captures and masks the token. The client ID matches
VERCEL_CLI_CLIENT_IDin Vercel's source, and a made-up one returnsApp not found.Unverified until it runs on
main: the exchange against a real OIDC token, and that[email protected]stays within the policy'sdeployscope. Reverting restores the previous behaviour.🤖 Generated with Claude Code