Skip to content

ci: introduce release app to restore main branch protection#2439

Merged
dunglas merged 2 commits into
mainfrom
ci/release-app
May 21, 2026
Merged

ci: introduce release app to restore main branch protection#2439
dunglas merged 2 commits into
mainfrom
ci/release-app

Conversation

@dunglas
Copy link
Copy Markdown
Member

@dunglas dunglas commented May 21, 2026

This will allow restoring default branch protection and prevent issues such as the one described in #2438.

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

Updates the release GitHub Actions workflow to perform release-time writes (commits/tags/workflow dispatches) using a GitHub App installation token instead of the workflow’s default GITHUB_TOKEN, enabling restoration of stricter main branch protection.

Changes:

  • Remove workflow-wide write permissions and set permissions: {}.
  • Generate a GitHub App token at runtime and use it for checkout and all gh API interactions.
  • Add a job-level guard to skip the release job when triggered by dunglas-release[bot].

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

Comment thread .github/workflows/release.yaml
Comment thread .github/workflows/release.yaml Outdated
Drop dead actor guard (release.sh dispatches as maintainer, never the
bot) and update the commit-and-tag step comment so the Verified
identity reflects dunglas-release[bot] instead of github-actions[bot].
dunglas added a commit to dunglas/mercure that referenced this pull request May 21, 2026
Mirror of php/frankenphp#2439. Swap GITHUB_TOKEN for a GitHub App token
so the release commit lands as the app identity, which can bypass main
branch protection rules without granting them to the workflow's default
token.

Requires `RELEASE_APP_ID` repo variable and `RELEASE_APP_PRIVATE_KEY`
secret to be configured with an app that has contents:write and
actions:write installation permissions.
dunglas added a commit to dunglas/mercure that referenced this pull request May 21, 2026
Mirror of php/frankenphp#2439. Swap GITHUB_TOKEN for a GitHub App token
so the release commit lands as the app identity, which can bypass main
branch protection rules without granting them to the workflow's default
token.

Requires `RELEASE_APP_ID` repo variable and `RELEASE_APP_PRIVATE_KEY`
secret to be configured with an app that has contents:write and
actions:write installation permissions.
@dunglas dunglas merged commit 7e1a133 into main May 21, 2026
31 checks passed
@dunglas dunglas deleted the ci/release-app branch May 21, 2026 13: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