Repository navigation
[ci] Move Turbopack, Rspack and font data workflows off of RELEASE_BOT_GITHUB_TOKEN - #93455
Conversation
Pure refactor: move the GitHub REST blob/tree/commit primitives from release-github-api.js into a reusable scripts/github-utils/signed-commit.js. Behavior is unchanged; release-github-api.js now composes createSignedCommit and alignLocalBranchWithSignedCommit, while still managing the release tag and branch ref directly via githubRequest. Subsequent commits will reuse these helpers for the manifest-update and sync-react workflows so they can produce GPG-signed commits via the API instead of unsigned git push.
Mints a short-lived token from the release GitHub App via actions/create-github-app-token@v3 instead of using the RELEASE_BOT_GITHUB_TOKEN PAT, and pushes the manifest update as a GPG-signed commit via the GitHub REST API instead of running git push (which would push an unsigned commit and fail branch protection on canary). scripts/automated-update-workflow.js now reads RELEASE_GITHUB_TOKEN for the signed commit and PR_GITHUB_TOKEN (=GH_TOKEN_PULL_REQUESTS) for PR creation, attributing both the local commit and the resulting bot user to the app via RELEASE_GITHUB_APP_SLUG / RELEASE_GITHUB_APP_USER_ID. upsertBranchRef is added to scripts/github-utils/signed-commit.js so the script can create the timestamped branch ref without first running git push.
Same pattern as the Turbopack manifest workflow: mints a release app token via actions/create-github-app-token@v3 instead of using RELEASE_BOT_GITHUB_TOKEN, and lets scripts/automated-update-workflow.js push the manifest update as a GPG-signed commit via the GitHub REST API. Workflow-only change; the script and helper changes already landed in the prior commit.
Same pattern as the manifest workflows: release app token via actions/create-github-app-token@v3 instead of RELEASE_BOT_GITHUB_TOKEN, and the existing scripts/automated-update-workflow.js handles the GPG-signed commit via the GitHub REST API.
RELEASE_BOT_GITHUB_TOKEN
Tests PassedCommit: 42b48fe |
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: 95b8c8a |
| * Build a GitHub tree matching a local commit, creating new blob objects for | ||
| * changed files in parallel while preserving deletions and submodules. | ||
| */ | ||
| async function createTreeFromLocalCommit({ |
There was a problem hiding this comment.
GitHub offers a GraphQL API that lets you do this in a single request, which they seem to recommend over the REST blob+tree+commit APIs: https://github.blog/changelog/2021-09-13-a-simpler-api-for-authoring-commits/
That's what I used for front: https://github.com/vercel/front/blob/main/tooling/github-actions/utils/ghcommit.ts
I also used octokit there. Raw fetch calls are fine too, but it looks like scripts/automated-update-workflow.js is already pulling in octokit.
There was a problem hiding this comment.
Will do in a follow-up
| headers: { | ||
| Accept: 'application/vnd.github+json', | ||
| Authorization: `Bearer ${token}`, | ||
| 'X-GitHub-Api-Version': '2022-11-28', |
There was a problem hiding this comment.
LLMs love using an ancient API version
| 'X-GitHub-Api-Version': '2022-11-28', | |
| 'X-GitHub-Api-Version': '2026-03-10', |
There was a problem hiding this comment.
I'll do that together with the GraphQL refactor in a follow-up. This is just moved code. Priority is getting everything back up.
There was a problem hiding this comment.
Decided to not do that. That's the default version so it can't be that bad. Changing it does put as through breaking changes so there should be a benefit.
|
FYI, we'll probably need to move again from app tokens to OIDC via https://vercel.slack.com/archives/C0AM84PRSGL/p1777319001082569 at some point. |
Co-authored-by: Benjamin Woodruff <[email protected]>
b60b4e0 to
42b48fe
Compare
RELEASE_BOT_GITHUB_TOKENis no longer working. Instead we use a dedicated GH app to push, sign and create commits that trigger workflows.Based off of #93245
I extracted #93285 into separate utils since we're no using those in 4 places (5 once I migrated the React sync which requires more work).