Commit cae018a
authored
ci: stop running CI twice on internal PRs (dfinity#3804)
Since dfinity#3782 added a
`pull_request` trigger, every commit on an internal PR branch fires
**both** `push` and `pull_request`, running every CI job twice. This PR
scopes the `push` trigger so PR branches fire only `pull_request`,
eliminating the duplicate runs.
## Changes
- [canister-tests.yml](.github/workflows/canister-tests.yml): `push` →
`branches: [main]` + `tags: ['release-*']`
- [frontend-checks.yml](.github/workflows/frontend-checks.yml): `push` →
`branches: [main]`
- [rust.yml](.github/workflows/rust.yml): `push` → `branches: [main]`
## When each trigger fires after this change
| Scenario | `push` | `pull_request` |
|---|---|---|
| Push to internal PR branch | — | ✓ |
| Push to fork PR branch | — | ✓ |
| Merge to `main` | ✓ | — |
| Push release tag (`release-*`) | ✓ (canister-tests only) | — |
Release flow, main-branch post-merge CI, and fork PR CI are preserved.
## Caveat — auto-commit formatting
The `cargo-fmt` auto-commit in `rust.yml` and the `Commit type
interfaces` step in `frontend-checks.yml` were previously gated on
`push` to non-`main` branches. Since `push` no longer fires on feature
branches, these steps are now inert. The conditions have been tightened
so they cannot spuriously fire on tag pushes. Re-enabling them for
same-repo PRs is possible but requires adjusting the `checkout` ref and
token handling, which is out of scope here — please run `cargo fmt` /
`npm run generate` locally until that follow-up lands.1 parent 711ccd8 commit cae018a
3 files changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
0 commit comments