Skip to content

Commit a509ffd

Browse files
committed
ci: skip CI runs on draft pull requests
### Why? Draft PRs are work-in-progress and don't need the full CI suite running on every push. Running lint, build, unit, integration, and e2e jobs on drafts wastes runner capacity and adds noise while the author is still iterating. ### What? - Guard every job (and the `required-checks` gate) with `github.event_name != 'pull_request' || github.event.pull_request.draft == false`. The `event_name` half keeps `push` (main) and `merge_group` (merge queue) running, since `pull_request.draft` is null for those events. - Preserve the `required-checks` gate's `if: always()` by combining it with the draft guard, so draft PRs don't fail on the gate's treat-skipped-as-failure logic. - Add `ready_for_review` to `pull_request.types` so CI triggers when a draft is marked ready — the existing opened/reopened/synchronize types don't fire on that transition. ### Test Plan ✅ YAML validated with `yaml.safe_load`. Behavior to confirm post-merge: draft PRs run no jobs; marking a PR ready, pushes to main, and merge queue all run the full suite.
1 parent b73f49c commit a509ffd

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- opened
1515
- reopened
1616
- synchronize
17+
- ready_for_review
1718
merge_group:
1819

1920
permissions:
@@ -25,6 +26,7 @@ jobs:
2526
# ---------------------------------------------------------------------------
2627
lint:
2728
name: Lint
29+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
2830
runs-on: ubuntu-latest
2931
steps:
3032
- uses: actions/checkout@v4
@@ -38,6 +40,7 @@ jobs:
3840
# ---------------------------------------------------------------------------
3941
tidy:
4042
name: Tidy
43+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
4144
runs-on: ubuntu-latest
4245
steps:
4346
- uses: actions/checkout@v4
@@ -54,6 +57,7 @@ jobs:
5457
# ---------------------------------------------------------------------------
5558
build-and-unit-test:
5659
name: Build and Unit Test
60+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
5761
runs-on: ubuntu-latest
5862
steps:
5963
- uses: actions/checkout@v4
@@ -70,6 +74,7 @@ jobs:
7074
# ---------------------------------------------------------------------------
7175
e2e:
7276
name: E2E Integration Test
77+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
7378
runs-on: ubuntu-latest
7479
steps:
7580
- uses: actions/checkout@v4
@@ -80,6 +85,7 @@ jobs:
8085

8186
gateway-integration-test:
8287
name: Gateway Integration Test
88+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
8389
runs-on: ubuntu-latest
8490
steps:
8591
- uses: actions/checkout@v4
@@ -90,6 +96,7 @@ jobs:
9096

9197
orchestrator-integration-test:
9298
name: Orchestrator Integration Test
99+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
93100
runs-on: ubuntu-latest
94101
steps:
95102
- uses: actions/checkout@v4
@@ -103,6 +110,7 @@ jobs:
103110
# ---------------------------------------------------------------------------
104111
counter-integration-test:
105112
name: Counter Extension Test
113+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
106114
runs-on: ubuntu-latest
107115
steps:
108116
- uses: actions/checkout@v4
@@ -113,6 +121,7 @@ jobs:
113121

114122
queue-integration-test:
115123
name: Queue Extension Test
124+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
116125
runs-on: ubuntu-latest
117126
steps:
118127
- uses: actions/checkout@v4
@@ -123,6 +132,7 @@ jobs:
123132

124133
storage-integration-test:
125134
name: Storage Extension Test
135+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
126136
runs-on: ubuntu-latest
127137
steps:
128138
- uses: actions/checkout@v4
@@ -136,6 +146,7 @@ jobs:
136146
# ---------------------------------------------------------------------------
137147
consumer-integration-test:
138148
name: Consumer Integration Test
149+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
139150
runs-on: ubuntu-latest
140151
steps:
141152
- uses: actions/checkout@v4
@@ -155,7 +166,7 @@ jobs:
155166
# ---------------------------------------------------------------------------
156167
required-checks:
157168
name: Required Checks
158-
if: always()
169+
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
159170
runs-on: ubuntu-latest
160171
needs:
161172
- lint

0 commit comments

Comments
 (0)