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.)
This commit is contained in:
Dan Stillman 2026-07-07 16:40:26 -04:00 committed by Dan Stillman
parent 4c392c4764
commit 62a431f42b

View file

@ -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: