Skip to content

ci: Use token-exchange action for workflow tokens#4029

Merged
Mrtenz merged 3 commits into
mainfrom
mrtenz/use-token-exchange-action
Jun 12, 2026
Merged

ci: Use token-exchange action for workflow tokens#4029
Mrtenz merged 3 commits into
mainfrom
mrtenz/use-token-exchange-action

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

Replace the Patroll-based PULL_REQUEST_UPDATE_TOKEN and PUBLISH_PAGES_TOKEN secrets with tokens fetched via the MetaMask/github-tools/get-token action. Patroll has proven unreliable, so this moves these workflows over to the token-exchange service instead.


Note

Medium Risk
Changes how write-capable tokens are issued for gh-pages deploys and bot commits to PR branches; failures depend on TOKEN_EXCHANGE_URL and environment protection being configured correctly.

Overview
Replaces Patroll-backed repo secrets PULL_REQUEST_UPDATE_TOKEN and PUBLISH_PAGES_TOKEN with short-lived tokens from MetaMask/github-tools/.github/actions/get-token@v1, using vars.TOKEN_EXCHANGE_URL and scoped GitHub permissions.

GitHub Pages (publish-github-pages.yml): removes the reusable workflow’s PUBLISH_PAGES_TOKEN secret input; the publish job fetches a token with contents: write and passes it to peaceiris/actions-gh-pages. Callers in main.yml, publish-main-docs.yml, and publish-release.yml no longer forward that secret.

PR automation (update-pull-request.yml): drops the PULL_REQUEST_UPDATE_TOKEN workflow_call secret; each job that needs API/git access runs get-token first (read vs write scopes per job) and uses steps.get-token.outputs.token for gh, checkout, and push. main.yml stops passing PULL_REQUEST_UPDATE_TOKEN into the Dependabot update job.

Reviewed by Cursor Bugbot for commit bdf6d3d. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread .github/workflows/publish-github-pages.yml Fixed
Comment thread .github/workflows/update-pull-request.yml Fixed
Comment thread .github/workflows/update-pull-request.yml Fixed
Comment thread .github/workflows/update-pull-request.yml Fixed
Comment thread .github/workflows/update-pull-request.yml Fixed
Comment thread .github/workflows/update-pull-request.yml Fixed
Comment thread .github/workflows/update-pull-request.yml Fixed
Comment thread .github/workflows/update-pull-request.yml Fixed
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@3d7452b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4029   +/-   ##
=======================================
  Coverage        ?   98.58%           
=======================================
  Files           ?      425           
  Lines           ?    12364           
  Branches        ?     1948           
=======================================
  Hits            ?    12189           
  Misses          ?      175           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Mrtenz added 3 commits June 12, 2026 13:57
Replace the `PULL_REQUEST_UPDATE_TOKEN` and `PUBLISH_PAGES_TOKEN`
secrets with scoped tokens fetched via the
`MetaMask/github-tools/get-token` action, so each job only receives the
permissions it actually needs.
`publish-github-pages.yml` no longer declares `PUBLISH_PAGES_TOKEN`, so
callers must stop passing it as a secret. Remove it from
`publish-release.yml` (both its `workflow_call.secrets` and the five
calls into `publish-github-pages.yml`) and from `main.yml`'s call to
`publish-release.yml`.
`publish-github-pages.yml` no longer declares the secret, so passing it
from `publish-main-docs.yml` fails actionlint.
@Mrtenz Mrtenz force-pushed the mrtenz/use-token-exchange-action branch from 56c32f6 to bdf6d3d Compare June 12, 2026 11:57
@Mrtenz Mrtenz marked this pull request as ready for review June 12, 2026 12:02
@Mrtenz Mrtenz requested a review from a team as a code owner June 12, 2026 12:02
@Mrtenz Mrtenz added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit c1e2412 Jun 12, 2026
132 checks passed
@Mrtenz Mrtenz deleted the mrtenz/use-token-exchange-action branch June 12, 2026 12:30
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.

4 participants