Commit 71d14b2
authored
ci: comment on issues auto-closed by a merged PR (merged != released) (#151)
## Problem
When a PR with `Closes #123` merges to `main`, 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:
> β
A fix has been merged to `main` in #142 and will ship in the next
release.
>
> GitHub auto-closed this issue on merge, but the change isn't published
yet β it'll go out with the next `bumpy` release. πΈ
## How it works
- Triggers on `pull_request_target: [closed]`, scoped to base branch
`main`, gated on `merged == true`.
- Uses the PR's GraphQL `closingIssuesReferences` to find exactly which
issues were closed β resolves every `Closes/Fixes/Resolves` variant
natively, no body regex.
- One comment per closed issue.
## Safety
- `pull_request_target` gives the `issues: write` token, but the
workflow **never checks out or runs PR code** β it only queries linked
issues and posts a comment.
- The workflow file always runs from `main`, so a fork PR can't alter
it.
- Only the PR number (int) and repo slug reach the shell β
injection-safe.
## Design notes
- **Kept separate from `release.yaml` on purpose.** That workflow runs
on the same merge (`push: [main]`), but a `push` event lacks the
PR/closing-issue data, and its always-run `plan` job is deliberately
zero-permission. This workflow is pure `gh` (no bun/build), so it's
cheap to keep standalone.
- **Toggle is file presence** β delete the workflow to disable. No
config for v1.
- **Activates after merge to `main`** β `pull_request_target` always
uses the base-branch copy, so it won't run from this PR itself.
- **Scoped to `main` only** β a `next` prerelease 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.1 parent 4960ffc commit 71d14b2
2 files changed
Lines changed: 122 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
309 | 367 | | |
310 | 368 | | |
311 | 369 | | |
| |||
0 commit comments