Repository navigation
Announce pull requests to Slack, post through a bot token, and call at version tags - #16
Conversation
…t version tags
New pull requests went unnoticed until someone opened the repository, which is how stacks of
Dependabot pull requests built up. The GitHub app for Slack posts every later event on a pull
request too, and cannot leave out forks, so slack-on-pull-request posts only a pull request
that needs action: opened or reopened and not a draft, or marked ready for review. Forks are
skipped, because their title and author would reach the channel through the token.
Dependabot's pull requests are posted, which is why the token is also a Dependabot secret.
Both Slack workflows now post with chat.postMessage through one bot token, to a channel each
caller names. Incoming webhooks needed one secret per channel, twice over for Dependabot. The
accepted cost is a broader credential: a leaked token can post to any channel the app is in.
The token reaches curl in a file rather than on its command line.
Callers move from commit pins to this repository's major-version tags. A commit pin needed a
pull request in every repository for every change here, and callers were moved together
anyway. The v* tags are protected by a ruleset whose bypass list is no wider than main's, so
moving a tag takes the same people as merging. action-pins accepts exactly this repository's
version tags; third-party actions still need a commit SHA. A push creating a v* tag from a
non-admin account was refused by the ruleset ("Cannot create ref due to creations being
restricted").
Breaking: the reporter requires a channel input and SLACK_BOT_TOKEN in place of SLACK_WEBHOOK,
so this is v2.0.0. The hygiene check fails a Slack call that names no channel, so a caller
moved to v2 without being changed fails its own pull request rather than breaking after merge.
The posting steps are tested by running the shipped scripts against stand-ins for curl and gh,
and action-pins over sample references. Removing the fork and draft filters, or the tag
exemption, fails those tests.
Claude review: approveSummaryThe change does what it sets out to do. The announcer's filters run in the right order: trigger, then action, then fork, then draft, and only after those the token and channel checks, so a fork pull request with no secrets is skipped rather than failed. The token is sent to curl through a header file. Untrusted pull request fields are passed through There are no Findings1. Maintainability: the hygiene script still says "the commit your repository pins". 2. Maintainability: the comment on the new premerge job is untrue, and its name is too narrow. Suggestion:
3. Maintainability: the migration guard checks only half of the breaking change.
That is exactly the outcome the README says the check prevents ( 4. Maintainability: recorded state in the docs and comments.
5. Preference: the posting and refusal handling is duplicated, and only one copy is tested in depth.
The reporter's copy is tested only for 6. Preference: README line wrapping.
What I checked
What I did not check
DeclinedNone. There were no earlier rounds. full review of |
…posting copies The hygiene check caught a caller moved to v2 without a channel, but not one still passing SLACK_WEBHOOK or not passing SLACK_BOT_TOKEN. That caller fails only after merge, in a watcher nothing reports, which is the outcome the check exists to prevent. It now fails both; `secrets: inherit` passes, since it carries the token. The posting and refusal handling is the same code copied into both Slack workflows, and only the announcer's copy was tested in depth. Every refusal, truncation, acceptance and curl failure case now runs against both, so a copy that drifts fails; breaking the reporter's truncation alone fails one test. The README and action-pins state the channel choice and the tag ruleset as conditions rather than as a description of current settings, which go stale. The premerge job is renamed for what it runs, which includes the action-pins tests, and its comment gives the real reason.
|
Review findings, all addressed in 12e2428 except one point in 4:
Not checked by the review, for the record: the 82 tests pass locally; actionlint is clean. |
Claude review: approveResolved
Still open None. Declined
New
No bugs found in the delta. In the hygiene change, What I checked
What I did not check
delta review of |
check_slack_calls_match_v2 and slack_channel_findings named a version and half the rule; the check now requires a channel and the token, so the names say that. Two comment lines edited in the previous commit had new wording spliced onto old lines past the 100-column wrap.
|
Both new points fixed in d18c20f: the two spliced lines are rewrapped ( |
Claude review: approveResolved
Still open None. Declined
New None. The delta is a rename and a rewrap, and I found no bugs, stale references or recorded-state claims in it. What I checked
What I did not check
delta review of |
What this changes
slack-on-pull-request.yaml. Posts a pull request that needs action - opened or reopened and not a draft, or marked ready for review - to the caller's channel, and nothing else about it. Forks are skipped, Dependabot's are posted, and each skip leaves a notice saying why. A call from any event butpull_requestfails, includingpull_request_target.slack-on-failure.yamlposts through a bot token. Both workflows usechat.postMessagewithSLACK_BOT_TOKENand a requiredchannelinput, replacingSLACK_WEBHOOK. A refusal fails the job with Slack's error code and a hint, such as inviting the app to the channel.announce-pull-requests.yamlis added and listed in the failure watcher; both post to#l337-org.action-pinsaccepts this repository's version tags. ExactlyL337-org/github-workflows/<path>@vNor@vN.N.N. Anything else at a tag or branch still fails.curlandgh, and the pin check over sample references, in a new premerge job.Breaking
The reporter's interface changes, so this is v2.0.0. Each caller moves to
v2in its own pull request, addingchanneland switching the secret at the same time; until then it stays on its current commit and keeps working.Tested
channelin docker-mcp and claude-routines from this change.v*tag from a non-admin account was refused by the tag ruleset.Not yet verified
#l337-org.workflow_runwatcher fires from the default branch.v2.0.0and movingv2under the tag ruleset's signed-commit rule has not been tried; that happens at release.v2also needs a failure watcher each.