From 62a431f42be57fbd089f54201ca0bb16cb8b4aaf Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 7 Jul 2026 16:40:26 -0400 Subject: [PATCH] CI: Don't run duplicate jobs for same-repo pull requests Pushes to branches in this repo already run CI, so run pull_request jobs only for PRs from forks, which don't trigger push runs here. The push run's checks still appear on the PR, since checks are attached to the head commit. (This skips merge-commit testing for same-repo PRs -- the push run tests the branch as-is.) --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d4988469a..be7c70a639 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,10 @@ jobs: test: name: Test (shard ${{ matrix.shard }}) runs-on: ubuntu-latest + # Same-repo PRs are covered by the push run, so run pull_request jobs only for forks + if: > + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.repository strategy: matrix: shard: [1, 2, 3, 4] @@ -83,6 +87,9 @@ jobs: utilities: name: Utilities Tests runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v4 with: