{{ message }}
Guard /pr skill against editing merged or closed PRs - #342
Merged
Merged
Conversation
The bundle job in release-notes.yml never passed repo or owner to the bundle-create action, leaving REPO blank in the gh-release step and causing 'Could not find product for repository ''' errors. Add both inputs explicitly and add a GITHUB_REPOSITORY fallback in the gh-release step of bundle-create/action.yml so callers that omit the inputs still resolve correctly. Co-Authored-By: Claude <noreply@anthropic.com>
Add state to the gh pr view query and check it before gh pr edit. MERGED or CLOSED → treat as no PR, create a new one instead. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Approved.
What is this? | From workflow: PR Review
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The `/pr` skill's step 7 previously ran `gh pr edit` on any PR returned by `gh pr view`, including merged ones. Adding `state` to the JSON query and checking it before editing prevents the skill from updating a PR that has already landed.
Why
`gh pr view` returns data for merged and closed PRs. Without a state check the skill would run `gh pr edit` on a merged PR, producing noise on a closed thread and confusing the branch history.
What
Step 7 now fetches `state` alongside `number`, `url`, and `baseRefName`. If `state` is `MERGED` or `CLOSED`, the instruction block directs the model to treat it as no PR and proceed to step 8 (create). Only `OPEN` PRs are updated.