Commit d9fc779
CI: run tests on all branch pushes, once per same-repo PR
The previous condition (github.event.pull_request == null) did not work:
github.event.pull_request is always null on push events regardless of whether
a PR exists, so the redundant run was never skipped.
Correct condition keeps on: [push, pull_request] and runs tests on every
branch push while avoiding the duplicate when a same-repo PR exists:
- push event: always runs (push to any branch, PR or not). On a push event
github.event.pull_request.head.repo.fork dereferences to an empty string
(falsy, no error), so the negation is true.
- same-repo PR: skipped, since that push already triggered a run.
- fork PR: runs via pull_request, since forks can't trigger a push here.
Verified against GitHub docs: dereferencing a missing context property
yields an empty string rather than an error.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>1 parent 1e82061 commit d9fc779
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
0 commit comments