ci: comment on issues auto-closed by a merged PR (merged != released)#151
Merged
Conversation
GitHub closes an issue the instant a PR with `Closes #123` merges to main, but with bumpy the fix is only merged, not published. "Closed" then reads as "shipped" to anyone watching the issue. This adds a small workflow that leaves a clarifying comment on each auto-closed issue: the fix is merged and will go out in the next release. - Triggers on pull_request_target: [closed] scoped to base branch main, gated on merged == true. Never checks out or runs PR code; only reads the PR's closingIssuesReferences (handles all Closes/Fixes/Resolves variants) and posts a comment. Injection-safe (only PR number + repo slug reach the shell). - Kept separate from release.yaml on purpose: the push event there lacks the PR/closing-issue data, and release.yaml's always-run plan job is deliberately zero-permission. This is pure gh (no bun/build), so it's cheap to run standalone. - Toggle is file presence; delete the workflow to disable. Release-time follow-up ("Released in vX.Y.Z") intentionally deferred.
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.
Problem
When a PR with
Closes #123merges tomain, GitHub closes the issue immediately — but with bumpy the fix is only merged, not published. To anyone watching the issue, "closed" reads as "shipped," which is misleading until the next release actually goes out.Approach
Rather than fight GitHub's auto-close (deferring it isn't possible; reopening spams notifications), just leave a clarifying comment on each auto-closed issue:
How it works
pull_request_target: [closed], scoped to base branchmain, gated onmerged == true.closingIssuesReferencesto find exactly which issues were closed — resolves everyCloses/Fixes/Resolvesvariant natively, no body regex.Safety
pull_request_targetgives theissues: writetoken, but the workflow never checks out or runs PR code — it only queries linked issues and posts a comment.main, so a fork PR can't alter it.Design notes
release.yamlon purpose. That workflow runs on the same merge (push: [main]), but apushevent lacks the PR/closing-issue data, and its always-runplanjob is deliberately zero-permission. This workflow is puregh(no bun/build), so it's cheap to keep standalone.main—pull_request_targetalways uses the base-branch copy, so it won't run from this PR itself.mainonly — anextprerelease merge won't trigger it (the "next release" wording wouldn't fit).Deferred
The release-time follow-up ("🎉 Released in vX.Y.Z") is intentionally left out — doing it reliably means distinguishing issue refs from PR refs in the release body, which is better solved by having bumpy track it than by regex. Happy to tackle in a follow-up.