Skip to content

ci(town-crier): resolve on unlabel — de-announce when the review label is removed#5

Merged
jasperboerhof merged 1 commit into
mainfrom
ci/town-crier-resolve-on-unlabel
Jun 20, 2026
Merged

ci(town-crier): resolve on unlabel — de-announce when the review label is removed#5
jasperboerhof merged 1 commit into
mainfrom
ci/town-crier-resolve-on-unlabel

Conversation

@jasperboerhof

Copy link
Copy Markdown
Contributor

What

Make the town-crier producer workflow (.github/workflows/announce-pr.yml) also de-announce a PR when its review label is removed — not just on close/merge.

Four edits:

  1. on.pull_request.types gains unlabeled.
  2. The resolve: job if: fires on either closed (with the label still present) or unlabeled of Agent Review Requested.
  3. The resolve step gains an ACTION env var and computes NOTE across three cases (review label removed / merged / closed without merge).
  4. Header comment amended to mention label removal.

Why

The producer only de-announced on close, and that close-resolve required the Agent Review Requested label to still be present. So unlabel-then-merge left the request stranded "open" on the town-crier bus forever — there is no GitHub→bus merge sync, so nothing else ever retired it.

Removing the label now immediately POSTs /resolve. The bus no-ops an unknown pr_url, so firing /resolve on an already-resolved or never-announced PR is always safe. The announce side is unchanged.

Verification

  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/announce-pr.yml'))"YAML OK.
  • No workflow/YAML/shell linter in this repo's CI (grep -rilE 'actionlint|yamllint|shellcheck' .github/ → none); composer scripts are PHP-only (test, phpstan, format) and don't touch this file.
  • Diff is exactly the four intended edits, 2-space indentation preserved to match the file.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NzAm5CqhSQTzD3PBuZHyfY

…l is removed

The producer only de-announced on close, and that close-resolve required the
"Agent Review Requested" label to still be present — so unlabel-then-merge left
the request stranded "open" on the town-crier bus forever (no GitHub->bus merge
sync). Now removing the label fires /resolve immediately (the bus no-ops an
unknown pr_url, so it's always safe). Announce side unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NzAm5CqhSQTzD3PBuZHyfY
@jasperboerhof jasperboerhof added the Agent Review Requested Requesting review of specialized AI review agents. label Jun 20, 2026
@jasperboerhof jasperboerhof added the Agent Review Requested Requesting review of specialized AI review agents. label Jun 20, 2026

@Goosterhof Goosterhof left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean follow-on. The unlabeled addition is correctly guarded and introduces no new injection surface — verified against the four edits the body claims, no drift.

  • Unlabel guard is correct. The resolve if: keys the unlabel branch on github.event.label.name == 'Agent Review Requested', which on the unlabeled action is the label that was just removed. Stripping an unrelated label (a wip/priority tag) won't fire a spurious /resolve — the false-de-announce trap is closed.
  • Triggers preserved. types: [labeled, unlabeled, closed] extends rather than replaces — announce (labeled) and close-resolve (closed) survive.
  • No new injection vector. The added ACTION env is github.event.action (a fixed enum, not attacker-controllable), and NOTE reaches curl via jq --arg. github.event.label.name is used only inside the if: expression (GitHub-evaluated), never interpolated into a run: shell.
  • Spine intact. permissions: {}, pull_request (not pull_request_target), and the loud-on-config-error / warn-on-bus-hiccup fail-open policy all carried through unchanged.

No findings. The body's "bus no-ops an unknown pr_url, so a redundant /resolve is safe" reasoning is sound, and CI is green (announce + check 8.4/8.5 pass; resolve correctly skips on this event).

Automated war-room agent review — posted because this PR carries the Agent Review Requested label.

Comment thread .github/workflows/announce-pr.yml
Comment thread .github/workflows/announce-pr.yml
@jasperboerhof jasperboerhof merged commit 620f98a into main Jun 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Agent Review Requested Requesting review of specialized AI review agents.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants