Skip to content

ci: scope push trigger to master so same-repo bot PRs run CI#635

Merged
narthur merged 1 commit intomasterfrom
fix/scope-ci-triggers
Apr 30, 2026
Merged

ci: scope push trigger to master so same-repo bot PRs run CI#635
narthur merged 1 commit intomasterfrom
fix/scope-ci-triggers

Conversation

@narthur
Copy link
Copy Markdown
Collaborator

@narthur narthur commented Apr 30, 2026

Summary

  • Scope the push trigger in .github/workflows/ci.yaml to branches: [master] and remove the per-job if: github.event_name == 'push' || github.event.pull_request.head.repo.fork gate.

Why

The old gate existed to avoid duplicate CI runs (both push and pull_request fire 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 as skipped. Two reasons that PR has no CI:

  1. The branch was pushed by github-actions[bot] using GITHUB_TOKEN, which by design does not trigger downstream workflows (recursion prevention). So no push event fires.
  2. The pull_request event does fire, but head.repo.fork == false, so the if: 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:

  • Push to a feature branch → no push event (only master is in the list), only pull_request runs CI. No duplicate.
  • Push to master post-merge → push runs CI. No PR exists at that point.
  • Fork PRs and same-repo bot PRs → pull_request runs CI. No more skips.

Test plan

  • CI runs on this PR (this is the test — if everything is skipped again, the change didn't take effect).
  • After merge, verify the next push to master triggers CI.
  • After merge, the next auto-generated chore/update-snapshots PR shows real check results.

🤖 Generated with Claude Code

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>
@dreeves dreeves temporarily deployed to fix/scope-ci-triggers - beeblog PR #635 April 30, 2026 14:05 — with Render Destroyed
@narthur narthur marked this pull request as ready for review April 30, 2026 14:06
Copilot AI review requested due to automatic review settings April 30, 2026 14:06
@github-actions
Copy link
Copy Markdown
Contributor

Build Performance

-0.01s (-0.2%) average build time

Base (18bce1d) Head (0d4240f)
Average 6.14s 6.13s
Runs 6.13,6.09,6.20 6.16,6.14,6.09

3 timed builds after one warm-up build per commit.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Accessibility Issues

Summary

No baseline issues found.

BaselineHead
00

Issue Breakdown

CodeBeforeAfterNet Change
View full breakdown

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 push trigger in CI to only master.
  • Remove the per-job if: gate so pull_request runs CI for same-repo PRs (including bot-authored PRs).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@narthur narthur merged commit c5ac0a2 into master Apr 30, 2026
14 of 16 checks passed
@narthur narthur deleted the fix/scope-ci-triggers branch April 30, 2026 14:09
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.

3 participants