Guard /pr skill against editing merged or closed PRs by Mpdreamz · Pull Request #342 · elastic/docs-actions · GitHub
Skip to content

Guard /pr skill against editing merged or closed PRs - #342

Merged
Mpdreamz merged 2 commits into
mainfrom
feat/bundle-create-repo-fallback
Sep 15, 2026
Merged

Mpdreamz merged 2 commits into
mainfrom
feat/bundle-create-repo-fallback

Conversation

@Mpdreamz

Copy link
Copy Markdown
Member

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.

Mpdreamz and others added 2 commits September 2, 2026 21:40
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>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner September 15, 2026 13:50
@Mpdreamz Mpdreamz added the chore label Sep 15, 2026
@Mpdreamz
Mpdreamz requested a review from akira28 September 15, 2026 13:50
@Mpdreamz Mpdreamz added the chore label Sep 15, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@Mpdreamz
Mpdreamz merged commit 312364f into main Sep 15, 2026
14 of 19 checks passed
@Mpdreamz
Mpdreamz deleted the feat/bundle-create-repo-fallback branch September 15, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant