Skip to content

Document auto-triggering release on prepare-release PR merge#358

Merged
runesoerensen merged 3 commits into
mainfrom
auto-trigger-release-on-prepare-pr-merge
May 18, 2026
Merged

Document auto-triggering release on prepare-release PR merge#358
runesoerensen merged 3 commits into
mainfrom
auto-trigger-release-on-prepare-pr-merge

Conversation

@runesoerensen
Copy link
Copy Markdown
Contributor

@runesoerensen runesoerensen commented May 14, 2026

Adds on: pull_request: [closed] and an if: gate to the documented release workflow example, so consumers can opt into having the release workflow auto-trigger when the auto-generated "Prepare release" PR is merged. Manual workflow_dispatch is preserved for re-runs and dry-run testing.

README-only change; the shared _buildpacks-release.yml is unchanged. The gating logic lives in the consumer alongside the trigger, so each consumer's release config remains self-documenting.

Also see heroku/buildpacks-dotnet#425

Resolves #96.

GUS-W-13871118

Adds an `on: pull_request: [closed]` trigger and an `if:` gate to the
documented release workflow example, so consumers can opt into having
the release workflow run automatically when the auto-generated
"Prepare release" PR is merged. Manual `workflow_dispatch` is preserved
for re-runs and dry-run testing.

GUS-W-13871118
Comment thread README.md
Comment thread README.md Outdated
A fork-source `pull_request` event already runs with secrets stripped
and a read-only `GITHUB_TOKEN`, so the publishing-side surface of the
release workflow is protected by GitHub's platform-level rule. But
adding `head.repo.full_name == github.repository` to the `if:` makes
that intent explicit, fails fast before any runner is provisioned, and
guards against a future GitHub policy change widening the fork
exposure.

No threat model exists today where a fork PR could trigger a release
that publishes; this is belt-and-suspenders.
The fork-source check guards against outside contributors, but doesn't
prevent an insider with push access from creating a `prepare-release`
branch in the base repo and merging it. Adding
`user.login == 'heroku-linguist[bot]'` closes that gap so only the
auto-generated PR (created by the GitHub App from
_buildpacks-prepare-release.yml) can trigger a release.
@runesoerensen runesoerensen requested a review from edmorley May 18, 2026 01:38
runesoerensen added a commit to heroku/buildpacks-dotnet that referenced this pull request May 18, 2026
Add two filters to the `if:` gate so only the auto-generated
prepare-release PR can trigger a release:

* `head.repo.full_name == github.repository` rejects fork-source PRs.
  Fork PRs already run without secrets, but the explicit check fails
  fast before a runner is provisioned and documents the intent.
* `user.login == 'heroku-linguist[bot]'` rejects branches pushed
  directly by an insider with push access — the fork check doesn't
  catch that case.

Mirrors the documented example from
heroku/languages-github-actions#358.
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.

Automatically trigger the release workflow on merge of the "Prepare release" PR

2 participants