From c354d0cc88fecf552d047368885732478fe3f90b Mon Sep 17 00:00:00 2001 From: Cody Lee Date: Sat, 28 Feb 2026 18:36:46 -0600 Subject: [PATCH] fix(release): automate PR creation and merge in release.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the manual "open a PR and press Enter" step with full gh-driven automation: - Require `gh` CLI as a prerequisite - Create the GitHub PR automatically with a structured description (Summary, Changes, Testing sections) - Prompt y/N before merging — exits cleanly on anything other than y - Merge via `gh pr merge --merge --delete-branch`, then proceed to pull main, verify version, tag, and push Co-Authored-By: Claude Sonnet 4.6 (1M context) --- scripts/release.sh | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index cfe28a4..fd468bc 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -9,8 +9,8 @@ # 3. Creates a release branch (chore/release-vX.Y.Z) # 4. Updates Cargo.toml + Cargo.lock # 5. Creates a signed commit and pushes the branch -# 6. Waits for you to merge the PR -# 7. Pulls main, creates an annotated tag, and pushes it +# 6. Opens a GitHub PR with release description, asks y/N to proceed +# 7. Merges the PR, pulls main, creates an annotated tag, and pushes it set -euo pipefail @@ -36,6 +36,7 @@ require git require git-semver require cargo require sed +require gh # ── validate repo state ─────────────────────────────────────────────────────── @@ -109,11 +110,44 @@ echo "committed version bump" git push -u origin "$BRANCH" echo "pushed: $BRANCH" -# ── wait for PR merge ───────────────────────────────────────────────────────── +# ── create GitHub PR ────────────────────────────────────────────────────────── echo "" -echo "open a PR for '$BRANCH', merge it into main, then press Enter to continue..." -read -r +echo "creating PR..." +PR_URL=$(gh pr create \ + --title "chore(release): bump version to ${NEW_TAG}" \ + --base main \ + --body "$(cat <