Release Pr
Merge a PR and release it to production
---
description: Merge a PR and release it to production
argument-hint: [pr-number]
allowed-tools: Bash(gh pr checks:*), Bash(gh pr view:*), Bash(gh pr merge:*), Bash(gh run list:*), Bash(gh run view:*), Bash(gh run watch:*), Bash(gh release list:*), Bash(gh release view:*), Bash(gh release edit:*)
---
## PR to release
PR number: $ARGUMENTS
## Step 1: Wait for PR checks to pass
Poll until all checks on the PR succeed:
```bash
gh pr checks $ARGUMENTS --watch --interval 30
If any check fails, stop and report the failure to the user. Do not proceed.
Step 2: Merge the PR
Merge the PR using a merge commit:
gh pr merge $ARGUMENTS --merge --delete-branch
Step 3: Wait for main branch CI to complete
After merging, the CI workflow runs on main. Find the run triggered by the merge and wait for it:
gh run list --branch main --workflow ci.yml --limit 1 --json databaseId,status
Wait a few seconds if the run hasn't appeared yet, then watch it:
gh run watch <run-id> --interval 30
The update-release-draft job at the end of CI creates or updates the draft release. If any job on main fails, stop and report to the user.
Step 4: Find the draft release and check the version bump
List recent releases to find the draft and the last published release:
gh release list --limit 5 --json tagName,name,isDraft
Identify the draft release (isDraft: true) and the most recent non-draft release. Parse their
semantic version numbers (e.g. v1.2.3) and determine whether the bump from the previous release
to the draft is a patch (only the third number changed), minor (second number changed), or
major (first number changed).
- If the bump is minor or major, stop and explicitly ask the user: "The draft release is
<draft-name>, which is a [minor/major] bump from<previous-name>. Is that correct?" Do not proceed until the user confirms. - If the bump is patch, proceed without asking.
Step 5: Publish the draft release
gh release edit <tag> --draft=false
Step 6: Wait for the release workflow to complete
After publishing, the release workflow runs. Find and watch it:
gh run list --workflow release.yml --limit 1 --json databaseId,status
gh run watch <run-id> --interval 30
Once complete, report success to the user with the release name and a summary of what was released. ```
Maintain Release Pr?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Release Pr on getagentictools](https://getagentictools.com/loops/neinteractiveliterature-release-pr?ref=badge)