ci: scope push trigger to master so same-repo bot PRs run CI#635
Merged
ci: scope push trigger to master so same-repo bot PRs run CI#635
Conversation
Previously every job had `if: github.event_name == 'push' || github.event.pull_request.head.repo.fork` to avoid duplicate runs (push + PR both firing on feature branches). That gate skipped CI entirely for same-repo PRs from bot-authored branches (e.g. chore/update-snapshots), since their pull_request event has head.repo.fork == false and no push event ever fires (GITHUB_TOKEN pushes don't trigger downstream workflows). Scoping the push trigger to master is the canonical fix: - Pushes to feature branches: no push event, only pull_request runs CI. No duplicate. - Pushes to master (post-merge): push event runs CI. No PR exists. - Forks and bot-authored same-repo PRs: pull_request runs CI normally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Build Performance⚡ -0.01s (-0.2%) average build time
|
Contributor
Accessibility IssuesSummaryNo baseline issues found.
Issue Breakdown
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the CI workflow triggers so same-repo PRs opened by bots (which don’t emit downstream push events when branches are updated via GITHUB_TOKEN) still run CI, while avoiding duplicate CI runs on same-repo feature branches.
Changes:
- Scope the
pushtrigger in CI to onlymaster. - Remove the per-job
if:gate sopull_requestruns CI for same-repo PRs (including bot-authored PRs).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pushtrigger in.github/workflows/ci.yamltobranches: [master]and remove the per-jobif: github.event_name == 'push' || github.event.pull_request.head.repo.forkgate.Why
The old gate existed to avoid duplicate CI runs (both
pushandpull_requestfire on feature branches in the same repo). It worked for human PRs, but it skipped CI entirely on same-repo PRs opened by bots — most visibly the auto-generated #634 chore: update snapshots, where every job shows up asskipped. Two reasons that PR has no CI:github-actions[bot]usingGITHUB_TOKEN, which by design does not trigger downstream workflows (recursion prevention). So nopushevent fires.pull_requestevent does fire, buthead.repo.fork == false, so theif:gate is false on every job and they all skip.Scoping the trigger instead of gating the jobs avoids the duplicate-run problem without that blind spot:
pushevent (onlymasteris in the list), onlypull_requestruns CI. No duplicate.masterpost-merge →pushruns CI. No PR exists at that point.pull_requestruns CI. No more skips.Test plan
skippedagain, the change didn't take effect).mastertriggers CI.chore/update-snapshotsPR shows real check results.🤖 Generated with Claude Code