Skip to content

fix(release): pass GITHUB_TOKEN to the Homebrew bump step#2466

Merged
dunglas merged 1 commit into
mainfrom
fix/homebrew-bump-github-token
Jun 4, 2026
Merged

fix(release): pass GITHUB_TOKEN to the Homebrew bump step#2466
dunglas merged 1 commit into
mainfrom
fix/homebrew-bump-github-token

Conversation

@dunglas
Copy link
Copy Markdown
Member

@dunglas dunglas commented Jun 4, 2026

mislav/bump-homebrew-formula-action uses two tokens:

const internalToken = process.env.GITHUB_TOKEN || process.env.COMMITTER_TOKEN || ''
const externalToken = process.env.COMMITTER_TOKEN || ''

The internal token reads the source repo (release tag lookup, tarball checksum); the external one writes to the tap. Our step only set COMMITTER_TOKEN, so the action fell back to it for source-repo calls. HOMEBREW_TOKEN is a fine-grained PAT scoped to dunglas/homebrew-frankenphp only (fine-grained PATs have no implicit public-repo access), so every call against php/frankenphp failed with unexpected HTTP 403 response. This broke the "Bump Homebrew formula" step of the v1.12.4 release runs.

Setting GITHUB_TOKEN restores the intended split: workflow token for reads here, tap-scoped PAT for the formula commit.

bump-homebrew-formula-action reads the source repo (release tag, tarball
checksum) with GITHUB_TOKEN and falls back to COMMITTER_TOKEN when it is
absent. The fine-grained HOMEBREW_TOKEN only grants access to the tap, so
source-repo calls failed with HTTP 403.
Copilot AI review requested due to automatic review settings June 4, 2026 06:28
@dunglas dunglas merged commit edaffab into main Jun 4, 2026
6 of 13 checks passed
@dunglas dunglas deleted the fix/homebrew-bump-github-token branch June 4, 2026 06:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the release workflow’s “Bump Homebrew formula” step to avoid mislav/bump-homebrew-formula-action using the tap-scoped PAT for source-repo reads (which can cause 403s when that PAT can’t access php/frankenphp).

Changes:

  • Adds GITHUB_TOKEN to the Homebrew bump step environment to separate source-repo reads from tap writes.
  • Documents (in-workflow) why two different tokens are needed for the action’s internal vs external GitHub calls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +387 to +390
# The action reads the source repo (release tag, tarball checksum) with
# GITHUB_TOKEN; without it, it falls back to COMMITTER_TOKEN, whose
# fine-grained PAT only sees the tap and gets 403 on this repo.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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.

2 participants