From e287c420ed2267931404e8c1b4d2cd58ea2fa232 Mon Sep 17 00:00:00 2001 From: Jerry Liu Date: Tue, 10 Nov 2026 10:36:15 -0800 Subject: [PATCH 1/3] ci: use the built-in GITHUB_TOKEN instead of FRONTEND_GH_TOKEN FRONTEND_GH_TOKEN is no longer available to this repo, so Canary fails with "GitHub token not found". Use the built-in token and grant the jobs the permissions auto needs. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/canary.yml | 3 ++- .github/workflows/publish.yml | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index ccaff9e92..26e75a821 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -7,7 +7,7 @@ on: types: [checks_requested] env: - GH_TOKEN: ${{ secrets.FRONTEND_GH_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true @@ -51,6 +51,7 @@ jobs: name: Canary permissions: contents: read + pull-requests: write id-token: write needs: build steps: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 00cdf730a..58ee93f9f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,8 +5,8 @@ on: - 'master' env: - GITHUB_TOKEN: ${{ secrets.FRONTEND_GH_TOKEN }} - GH_TOKEN: ${{ secrets.FRONTEND_GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true @@ -20,7 +20,6 @@ jobs: steps: - uses: actions/checkout@v6 with: - token: ${{ secrets.FRONTEND_GH_TOKEN }} fetch-depth: 0 fetch-tags: true @@ -70,7 +69,9 @@ jobs: runs-on: ubuntu-latest name: Publish permissions: - contents: read + contents: write + pull-requests: write + issues: write id-token: write needs: build if: needs.build.outputs.version_bumped == 'true' @@ -78,7 +79,6 @@ jobs: steps: - uses: actions/checkout@v6 with: - token: ${{ secrets.FRONTEND_GH_TOKEN }} fetch-depth: 0 fetch-tags: true From 476e38f2f0b4438b97d36481c90a3fff2bd30ee2 Mon Sep 17 00:00:00 2001 From: Jerry Liu Date: Tue, 10 Nov 2026 10:42:19 -0800 Subject: [PATCH 2/3] ci: scope tokens to the steps that need them Move GH_TOKEN, NPM_TOKEN and NPM_CONFIG_PROVENANCE out of the workflow-level env block and onto the auto steps. Install and build steps no longer see the tokens. Give the Publish build job explicit read-only permissions. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/canary.yml | 9 ++++----- .github/workflows/publish.yml | 17 +++++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 26e75a821..dde681a83 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -6,11 +6,6 @@ on: merge_group: types: [checks_requested] -env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_CONFIG_PROVENANCE: true - jobs: build: runs-on: ubuntu-latest @@ -79,3 +74,7 @@ jobs: - name: Create Canary Release run: yarn auto canary + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 58ee93f9f..a858e0473 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,16 +4,13 @@ on: branches: - 'master' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_CONFIG_PROVENANCE: true - jobs: build: runs-on: ubuntu-latest name: Build + permissions: + contents: read + pull-requests: read if: "!contains(github.event.head_commit.message, 'skip-release')" outputs: version_bumped: ${{ steps.version-check.outputs.version_bumped }} @@ -36,6 +33,9 @@ jobs: - name: Apply semver updates (if any) id: version-check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | AUTO_VERSION=$(yarn auto version) EXIT_CODE=$? @@ -101,3 +101,8 @@ jobs: - name: Create Release run: yarn auto shipit + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: true From 7f51ca3fea8248d1e90b9f2bc92ea6e077eb19e1 Mon Sep 17 00:00:00 2001 From: Jerry Liu Date: Tue, 10 Nov 2026 10:46:14 -0800 Subject: [PATCH 3/3] ci: use only GITHUB_TOKEN auto reads GH_TOKEN or GITHUB_TOKEN for the API, and uses GITHUB_TOKEN (with the x-access-token prefix) for git pushes in Actions. GH_TOKEN was redundant. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/canary.yml | 2 +- .github/workflows/publish.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index dde681a83..61aefedd1 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -75,6 +75,6 @@ jobs: - name: Create Canary Release run: yarn auto canary env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a858e0473..3b7396c93 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,7 +35,6 @@ jobs: id: version-check env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | AUTO_VERSION=$(yarn auto version) EXIT_CODE=$? @@ -103,6 +102,5 @@ jobs: run: yarn auto shipit env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true