Skip to content

Commit 0387366

Browse files
hyperpolymathclaude
andcommitted
ci(scorecard-enforcer): split score-threshold from publish job
Replace local copy with the post-#304 standards template. The pre-fix shape has the OSSF publish contract violation: webapp: scorecard job must only have steps with uses Post-fix shape: - `scorecard` job: uses-only (now includes upload-artifact for SARIF hand-off) - `check-score` job: `needs: scorecard`, downloads artifact, runs threshold gate Caught 49 estate repos on the 2026-05-30 audit. Detector: hypatia rule WF014. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 48a9115 commit 0387366

1 file changed

Lines changed: 33 additions & 5 deletions

File tree

.github/workflows/scorecard-enforcer.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,27 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.ref }}
1818
cancel-in-progress: true
1919

20-
permissions: read-all
20+
permissions:
21+
contents: read
2122

2223
jobs:
24+
# The OSSF Scorecard publish endpoint enforces a hard contract: the job that
25+
# runs `ossf/scorecard-action` with `publish_results: true` must contain
26+
# ONLY steps with `uses:` (no `run:` steps in the same job). If a `run:`
27+
# step is present, the publish step fails with:
28+
# "webapp: scorecard job must only have steps with uses"
29+
# (49 estate repos hit this; see ROADMAP audit 2026-05-30.)
30+
#
31+
# Fix: split the threshold check into a downstream job that depends on
32+
# `scorecard` and consumes the SARIF artifact. The `scorecard` job stays
33+
# uses-only; `check-score` is the gating job that emits the error.
2334
scorecard:
2435
runs-on: ubuntu-latest
2536
permissions:
2637
security-events: write
2738
id-token: write # For OIDC
2839
steps:
29-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
40+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3041
with:
3142
persist-credentials: false
3243

@@ -38,13 +49,30 @@ jobs:
3849
publish_results: true
3950

4051
- name: Upload SARIF
41-
uses: github/codeql-action/upload-sarif@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v3
52+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4
4253
with:
4354
sarif_file: results.sarif
4455

56+
- name: Persist SARIF for downstream score-gate job
57+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
58+
with:
59+
name: scorecard-results
60+
path: results.sarif
61+
retention-days: 1
62+
63+
check-score:
64+
needs: scorecard
65+
runs-on: ubuntu-latest
66+
permissions:
67+
contents: read
68+
steps:
69+
- name: Download SARIF from scorecard job
70+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v5.0.0
71+
with:
72+
name: scorecard-results
73+
4574
- name: Check minimum score
4675
run: |
47-
# Parse score from results
4876
SCORE=$(jq -r '.runs[0].tool.driver.properties.score // 0' results.sarif 2>/dev/null || echo "0")
4977
5078
echo "OpenSSF Scorecard Score: $SCORE"
@@ -61,7 +89,7 @@ jobs:
6189
check-critical:
6290
runs-on: ubuntu-latest
6391
steps:
64-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
92+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6593

6694
- name: Check SECURITY.md exists
6795
run: |

0 commit comments

Comments
 (0)