Skip to content

Commit 3c9f6ec

Browse files
committed
fix(ci): eliminate redundant CI workflow executions
Merge Gate and On Push Qualification both called qualification.yaml on every push and PR, doubling test/lint/e2e/scan jobs. Standalone CodeQL, vuln-scan, actionlint, and verify-licenses workflows further tripled some checks. This consolidation removes ~45% of redundant runner usage: - Remove push trigger from Merge Gate (PR-only gate; strict status checks guarantee merge commit matches PR preview) - Remove PR trigger from On Push Qualification (Merge Gate covers PRs) - Remove inline vuln-scan from Merge Gate (qualification.yaml already includes security-scan) - Delete standalone actionlint.yaml and verify-licenses.yaml (fully subsumed by Merge Gate) - Strip push/PR triggers from codeql.yaml and vuln-scan.yaml (keep schedule-only backstops) - Re-point on-push-comment.yaml to trigger from Merge Gate - Fix unquoted $GITHUB_OUTPUT references (shellcheck SC2086)
1 parent 07d9ab9 commit 3c9f6ec

7 files changed

Lines changed: 15 additions & 235 deletions

File tree

.github/workflows/actionlint.yaml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/codeql.yaml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,13 @@
1515
name: "CodeQL"
1616

1717
on:
18-
push:
19-
branches:
20-
- main
21-
paths-ignore:
22-
- '**.md'
23-
- 'docs/**'
24-
- 'LICENSE'
25-
pull_request:
26-
branches:
27-
- main
28-
paths-ignore:
29-
- '**.md'
30-
- 'docs/**'
31-
- 'LICENSE'
3218
schedule:
3319
- cron: '0 5 * * 1'
20+
workflow_dispatch: {}
3421

3522
permissions:
3623
contents: read
3724

38-
concurrency:
39-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
40-
cancel-in-progress: true
41-
4225
jobs:
4326
analyze:
4427
runs-on: ubuntu-latest

.github/workflows/merge-gate.yaml

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
name: Merge Gate
2828

2929
on:
30-
push:
31-
branches:
32-
- main
3330
pull_request:
3431
branches:
3532
- main
@@ -40,7 +37,7 @@ permissions:
4037

4138
concurrency:
4239
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
43-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
40+
cancel-in-progress: true
4441

4542
jobs:
4643

@@ -159,36 +156,6 @@ jobs:
159156
steps:
160157
- run: echo "Docs/non-code change — CodeQL analysis not required"
161158

162-
# ---------------------------------------------------------------------------
163-
# Vulnerability scan (grype)
164-
# ---------------------------------------------------------------------------
165-
166-
vuln-scan:
167-
needs: [check-paths]
168-
if: needs.check-paths.outputs.code == 'true'
169-
runs-on: ubuntu-latest
170-
timeout-minutes: 30
171-
permissions:
172-
actions: read
173-
contents: read
174-
security-events: write
175-
steps:
176-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
177-
with:
178-
persist-credentials: false
179-
- uses: ./.github/actions/security-scan
180-
with:
181-
severity-cutoff: 'medium'
182-
category: 'anchore-fs'
183-
184-
vuln-scan-skip:
185-
needs: [check-paths]
186-
if: needs.check-paths.outputs.code != 'true'
187-
runs-on: ubuntu-latest
188-
timeout-minutes: 1
189-
steps:
190-
- run: echo "Docs/non-code change — vulnerability scan not required"
191-
192159
# ---------------------------------------------------------------------------
193160
# Malware scan (ClamAV)
194161
# ---------------------------------------------------------------------------
@@ -307,8 +274,6 @@ jobs:
307274
- tests-skip
308275
- analyze
309276
- analyze-skip
310-
- vuln-scan
311-
- vuln-scan-skip
312277
- malware-scan
313278
- malware-scan-skip
314279
- actionlint

.github/workflows/on-push-comment.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ name: Post PR Comment
2020

2121
on:
2222
workflow_run:
23-
workflows: ["On Push Qualification"]
23+
workflows: ["Merge Gate"]
2424
types:
2525
- completed
2626

2727
permissions:
2828
contents: read
2929

3030
jobs:
31-
# COUPLING: This workflow depends on "On Push Qualification" producing these artifacts:
31+
# COUPLING: This workflow depends on "Merge Gate" producing these artifacts (via qualification.yaml):
3232
# - coverage-pr (coverage.out from PR build)
3333
# - coverage-comment-data (JSON: coverage, threshold, pass, color, pr_number)
3434
# - coverage-baseline (coverage.out from last successful main build)
@@ -107,16 +107,16 @@ jobs:
107107
--repo ${{ github.repository }} \
108108
--name coverage-baseline \
109109
--dir /tmp/baseline-coverage 2>/dev/null; then
110-
echo "baseline_found=true" >> $GITHUB_OUTPUT
110+
echo "baseline_found=true" >> "$GITHUB_OUTPUT"
111111
echo "✅ Baseline coverage downloaded"
112112
else
113-
echo "baseline_found=false" >> $GITHUB_OUTPUT
113+
echo "baseline_found=false" >> "$GITHUB_OUTPUT"
114114
echo "⚠️ Failed to download baseline (first run?)"
115115
# Create empty baseline
116116
echo "mode: set" > /tmp/baseline-coverage/coverage.out
117117
fi
118118
else
119-
echo "baseline_found=false" >> $GITHUB_OUTPUT
119+
echo "baseline_found=false" >> "$GITHUB_OUTPUT"
120120
echo "⚠️ No successful baseline run found"
121121
echo "mode: set" > /tmp/baseline-coverage/coverage.out
122122
fi
@@ -169,18 +169,18 @@ jobs:
169169
/tmp/baseline-coverage/coverage.out \
170170
/tmp/pr-coverage/coverage.out \
171171
.github/outputs/all_modified_files.json > delta-report.md 2> delta-error.log; then
172-
echo "delta_generated=true" >> $GITHUB_OUTPUT
172+
echo "delta_generated=true" >> "$GITHUB_OUTPUT"
173173
else
174-
echo "delta_generated=false" >> $GITHUB_OUTPUT
174+
echo "delta_generated=false" >> "$GITHUB_OUTPUT"
175175
echo "⚠️ Delta generation failed:"
176176
cat delta-error.log || true
177177
fi
178178
179179
# Check if report shows no change (to reduce noise)
180180
if grep -q "will \*\*not change\*\* overall coverage" delta-report.md 2>/dev/null; then
181-
echo "no_change=true" >> $GITHUB_OUTPUT
181+
echo "no_change=true" >> "$GITHUB_OUTPUT"
182182
else
183-
echo "no_change=false" >> $GITHUB_OUTPUT
183+
echo "no_change=false" >> "$GITHUB_OUTPUT"
184184
fi
185185
186186
- name: Post PR Comment

.github/workflows/on-push.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ on:
2323
- 'docs/**'
2424
- 'site/**'
2525
- 'LICENSE'
26-
pull_request:
27-
branches:
28-
- main
29-
paths-ignore:
30-
- '**.md'
31-
- 'docs/**'
32-
- 'site/**'
33-
- 'LICENSE'
3426
workflow_dispatch: {} # Allow manual runs
3527

3628
permissions:
@@ -45,10 +37,10 @@ env:
4537
EXPECTED_PLATFORMS: "linux/amd64 linux/arm64"
4638

4739
concurrency:
48-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
49-
# Cancel in-progress PR runs but not main pushes — every main merge must
50-
# complete to produce its immutable sha-<commit> image tag.
51-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
40+
group: ${{ github.workflow }}-${{ github.ref }}
41+
# Never cancel main pushes — every merge must complete to produce its
42+
# immutable sha-<commit> image tag.
43+
cancel-in-progress: false
5244

5345
jobs:
5446

.github/workflows/verify-licenses.yaml

Lines changed: 0 additions & 87 deletions
This file was deleted.

.github/workflows/vuln-scan.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,10 @@ on:
1818
schedule:
1919
- cron: '30 7 * * *'
2020
workflow_dispatch: {} # allow manual runs for testing
21-
pull_request:
22-
branches: [main]
23-
paths-ignore:
24-
- '**.md'
25-
- 'docs/**'
26-
- 'LICENSE'
27-
push:
28-
branches: [main] # scan main after merges
29-
paths-ignore:
30-
- '**.md'
31-
- 'docs/**'
32-
- 'LICENSE'
3321

3422
permissions:
3523
contents: read
3624

37-
concurrency:
38-
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
39-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
40-
4125
jobs:
4226
vuln-scan:
4327
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)