From 6c012ac16d97953f1c3f1886ad9242b86f74eda0 Mon Sep 17 00:00:00 2001 From: Bryce Boe Date: Sun, 7 Jun 2026 11:16:43 -0700 Subject: [PATCH] Auto-merge release PRs once checks pass Merging the release PR is mechanical; the human gate for shipping is publishing the draft release that tag_release creates. The App enables GitHub auto-merge (merge commit, preserving the message pattern tag_release matches), so the PR lands when required status checks pass. Requires the repo setting 'Allow auto-merge'. --- .github/workflows/prepare_release.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml index 1d261c5..e4645c7 100644 --- a/.github/workflows/prepare_release.yml +++ b/.github/workflows/prepare_release.yml @@ -45,7 +45,8 @@ jobs: rm tmp_version - name: Commit changes with development version run: git commit -am "Set development version v$dev_version" - - name: Create Pull Request + - id: create-pr + name: Create Pull Request uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: body: "" @@ -53,6 +54,15 @@ jobs: draft: false title: Release v${{ env.version }} token: ${{ steps.app-token.outputs.token }} + # Merging the release PR is mechanical once checks pass; the human gate + # for shipping is publishing the draft release that tag_release creates. + # A merge commit is required so tag_release can match the message and + # locate the bump commit at HEAD^2^. + - name: Enable auto-merge + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }} + run: gh pr merge --auto --merge "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" name: Prepare Release on: