Skip to content

Say pull_request, because pull_request_target never fired - #20

Merged
darksidemilk merged 1 commit into
mainfrom
ci-correct-merge-trigger-docs
Aug 18, 2026
Merged

Say pull_request, because pull_request_target never fired#20
darksidemilk merged 1 commit into
mainfrom
ci-correct-merge-trigger-docs

Conversation

@darksidemilk

Copy link
Copy Markdown
Member

What

#17 described the merge entry point as pull_request_target: closed. That is what fogproject's stub used, and it did not work.

GitHub reads a pull_request_target workflow from the repository's default branch (stable), not from the PR's base branch — so a stub living on working-1.6/dev-branch was never consulted. It never registered as a workflow at all, and four PRs merged into working-1.6 without it running.

fogproject has moved the stub to pull_request: types: [closed] (FOGProject/fogproject#1171, #1172), which is read from the base branch and so reaches the file where it actually lives. This brings the description here back in line with what the caller does.

Why it records the reason and not just the fact

pull_request_target is the obvious-looking choice — it is the variant that gets secrets on a fork PR — so without the reason written down, the natural next move is to switch it back. The cost of pull_request is that a merged fork PR has no secrets and is skipped by the stub's same-repo guard; the schedule already covers those, exactly as it covers direct pushes.

New standing rule

Adds a second rule alongside the trigger-safety one, because they're different questions and only the first was written down:

  • Safety: can the bot's own push raise this event? (unchanged)
  • New — reachability: which ref is this trigger read from? Most events, including pull_request_target, schedule and workflow_dispatch, are read only from the default branch; push, create and pull_request resolve per-ref.

It ends by saying to confirm a new trigger actually produced a run — because a workflow that is correct but never runs is indistinguishable from one that ran and found nothing to do, which is precisely how this went unnoticed.

Verified

actionlint clean. No behavioural change in this repo — comments and CLAUDE.md only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PqufBbuckux8kitJeW3uAK

#17 described the merge entry point as `pull_request_target: closed`. That
was what fogproject's stub used, and it did not work: GitHub reads a
`pull_request_target` workflow from the repository's DEFAULT branch,
`stable`, rather than from the pull request's base branch, so a stub living
on working-1.6/dev-branch was never consulted. It never registered as a
workflow at all, and four PRs merged into working-1.6 without it running.

fogproject has moved the stub to `pull_request: types: [closed]`, which is
read from the base branch and so reaches the file where it actually lives.
This brings the description here back in line with what the caller does.

Records why, not just what. `pull_request_target` is the obvious-looking
choice -- it is the variant that gets secrets on a fork PR -- so without the
reason written down the natural next move is to switch it back. The cost of
`pull_request` is that a merged fork PR has no secrets and is skipped by the
stub's same-repo guard; the schedule already covers those, as it does direct
pushes.

Adds a second standing rule alongside the trigger-safety one, because they
are different questions and only the first was written down. The safety
question is "can the bot's own push raise this event". The new one is "which
ref is this trigger read from" -- most events, including
pull_request_target, schedule and workflow_dispatch, are read only from the
default branch, while push, create and pull_request resolve per-ref. A
workflow that is correct but never runs is indistinguishable from one that
ran and found nothing to do, which is exactly how this went unnoticed, so
the rule ends by saying to confirm a new trigger actually produced a run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PqufBbuckux8kitJeW3uAK
@darksidemilk
darksidemilk merged commit e7d15af into main Aug 18, 2026
@darksidemilk
darksidemilk deleted the ci-correct-merge-trigger-docs branch August 18, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant