← ClaudeAtlas

watch-what-the-merge-triggeredlisted

Use immediately after merging into a branch that workflows watch — an integration branch, a release branch, anything with `on: push`. Fires on "merged", "it landed", "that's in now" when the base has deploy, migrate, publish or notify workflows, and whenever a merged PR touched a workflow file or a path some workflow filters on. Owns the run the MERGE starts: which workflows it triggers, watching them to a terminal state pinned to the merge commit, and treating that run as the first and only exercise of merge-time credentials. Do NOT fire for a merge into a branch nothing watches, for the PR's own checks (await-pr-checks owns those), or to confirm that the merged diff contains what was claimed, which is a question about content rather than about runs.
damson/hard-won-skills · ★ 1 · Code & Development · score 67
Install: claude install-skill damson/hard-won-skills
# Watch what the merge triggered A pull request's checks run on a merge *preview*, with pull-request-scoped secrets. The merge produces a different commit, and `on: push` workflows run against it holding credentials a pull request was deliberately denied — so the first run after a merge is not a repeat of the PR's checks but the first execution of a configuration nothing could have tested. The failure it catches is specific: **code that only runs after a merge, and tooling that only runs after a failure.** Both are invisible until they are the only thing left working. ## Procedure ### 1. Get the merge commit, and hold it ```bash mc=$(gh pr view <n> --json mergeCommit --jq .mergeCommit.oid) base=$(gh pr view <n> --json baseRefName --jq .baseRefName) case "$mc" in [0-9a-f]*[0-9a-f]) [ ${#mc} -eq 40 ] || exit 1;; *) exit 1;; esac ``` **Check the shape before using it.** An unmerged pull request, a wrong number, or a merge queue still holding the merge all give an empty string or the literal `null`, and every step below interpolates `$mc` into a filter that then matches nothing. Step 3 reads "no run for `$mc`" as a legitimate answer, so without this guard a typo produces a confident all-clear. Every read below is pinned to `$mc`. A run for the branch tip is the PR's run, and a run for "the latest push to base" may be somebody else's merge a minute later — which is not a hypothetical on a repo with more than one session working. ### 2. Work out what SHOULD have started, be