Commit 8a1c299
authored
ci: skip CI for fork, draft, and work-in-progress PRs (#259)
## Summary
Add workflow guards to prevent unnecessary CI runs and reduce noise:
- **Fork-internal PRs**: CI no longer triggers when running inside a
fork repository (fork→upstream PRs still trigger normally)
- **Draft PRs**: CI skips draft PRs entirely
- **WIP PRs**: CI skips PRs with `WIP` or `wip` in the title
- **ready_for_review**: CI re-triggers automatically when a draft PR is
marked as ready
- **Feishu notification**: Skip notification when CI conclusion is
`skipped`
## Changed files
| File | Change |
|------|--------|
| `.github/workflows/ci.yml` | Add `ready_for_review` type; guard on
`lint` job (gates entire pipeline) |
| `.github/workflows/code-scan.yml` | Add `ready_for_review` type;
guards on `codeql` and `dependency-review` jobs |
| `.github/workflows/labeler.yml` | Add `ready_for_review` type; guard
on `label` job |
| `.github/workflows/notify-feishu.yml` | Skip notification when
`workflow_run.conclusion == 'skipped'` |
## How it works
The guard condition uses `github.repository ==
'flagos-ai/vllm-plugin-FL'` to distinguish fork-internal runs from
upstream runs:
- **Fork-internal PR** (e.g. fork's feature → fork's main): workflow
runs in the fork repo → condition is false → CI skipped
- **Fork→upstream PR**: workflow runs in upstream repo → condition is
true → CI runs normally
- **Upstream-internal PR**: same as above → CI runs normally
For `ci.yml`, the guard is placed only on the `lint` job. Since all
downstream jobs (`build`, `discover`, `test-*`) chain via `needs: lint`,
skipping `lint` skips the entire pipeline.
Reusable workflows (`_lint.yml`, `_build_wheel.yml`, etc.) don't need
changes since they are invoked via `workflow_call` and inherit the
caller's filtering.
For example:
<img width="1359" height="173" alt="screenshot-20260701-180959"
src="https://github.com/user-attachments/assets/37456a4b-83e6-486e-989f-32a72148fc12"
/>
such prs in draft status will not trigger ci, as long as those with
"wip" in the title
<img width="1389" height="710" alt="image"
src="https://github.com/user-attachments/assets/ab503167-1b74-4b8b-9d8c-0b2d4bcfb651"
/>
after click ready for review, workflow will detect status and trigger ci1 parent 9dded24 commit 8a1c299
4 files changed
Lines changed: 33 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
78 | 92 | | |
79 | | - | |
80 | 93 | | |
81 | 94 | | |
82 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
0 commit comments