Skip to content

Commit e0caf11

Browse files
feat(governance): add scorecard-reusable.yml — close 5-candidate convergence set (#205)
## Summary 5th and final reusable in the workflow convergence campaign (see #199 for the meta-doc). Consolidates the per-repo `scorecard.yml` workflow. ## Drift signal (full pagination + per-repo verified) - **258** top-level estate deployments - **626** nested copies in monorepos (asdf-tool-plugins, developer-ecosystem, ssg-collection, standards, ambientops, julia-ecosystem, etc. — Layer-2 truncation discovery via #204's helper) - **46** unique blob SHAs / 17.8% structural drift - Top SHA covers **100/258 (38.8%)** — highest dominant-cluster of the 5 campaigns - Top 7 SHAs cover ~80% - **100% mechanical drift, ZERO feature variance** — SPDX header (PMPL-1.0 / PMPL-1.0-or-later / MPL-2.0), `upload-sarif` SHA-pin churn, `permissions: read-all` vs `contents: read` wording ## Design - One input: `runs-on` (default ubuntu-latest) - No `secrets: inherit` — Scorecard uses `GITHUB_TOKEN` directly - Caller MUST grant `security-events: write` + `id-token: write` on the calling job (called-workflow permissions are capped by caller) - Caller keeps own `on:` triggers + `concurrency:` group ## Per Layer-3 caveat from the campaign meta-doc Nested workflows are inert — GitHub Actions only runs `.github/workflows/` at the repo root. Sweeping the 626 nested copies is single-source-of-truth cleanup, not security hardening. ## Campaign convergence set (closes with this PR) | PR | Template | |---|---| | #187 | mirror-reusable.yml | | #190 | secret-scanner-reusable.yml | | #192 | codeql-reusable.yml | | #193 | hypatia-scan-reusable.yml | | #194 | sweep-classifier scripts | | #199 | campaign meta-doc | | #204 | list-workflow-paths.sh (bypass /search/code undercount) | | **this** | **scorecard-reusable.yml** | ## Test plan - [ ] Wrapper sweep (~258 top-level + ~626 nested) — owner-gated; not part of this PR - [ ] Update classify-* scripts to consume helper TSV — follow-up 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 8e05422 commit e0caf11

1 file changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# scorecard-reusable.yml — Reusable OSSF Scorecard analysis.
3+
#
4+
# Consolidates the per-repo `scorecard.yml` workflow (estate-wide:
5+
# 258 top-level deployments, 46 unique blob SHAs, 17.8% structural
6+
# drift — top SHA covers 100/258 (38.8%), top 7 SHAs cover 80%).
7+
# Sampled top + long-tail variants are all the same single-`analysis`-
8+
# job shape (41 lines canonical); 100% of drift is mechanical:
9+
# SPDX-header lag (PMPL-1.0 / PMPL-1.0-or-later / MPL-2.0),
10+
# `github/codeql-action/upload-sarif` SHA-pin drift, and
11+
# `permissions: read-all` vs `permissions: contents: read` wording.
12+
# Zero feature variance across all 46 SHAs.
13+
#
14+
# Plus 626 nested copies in monorepos (asdf-tool-plugins, developer-
15+
# ecosystem, ssg-collection, standards, ambientops, julia-ecosystem,
16+
# etc.). Per Layer-3 caveat (see scripts/sweep-classifiers/README.adoc),
17+
# nested workflows are inert — GitHub Actions only runs the repo-root
18+
# `.github/workflows/` directory. Sweeping nested copies is
19+
# single-source-of-truth cleanup, not security hardening.
20+
#
21+
# Design:
22+
# - One input only: `runs-on` (default ubuntu-latest).
23+
# - No `secrets: inherit` needed — scorecard uses `GITHUB_TOKEN`
24+
# directly, which is available without inherit.
25+
# - Caller MUST grant `security-events: write` and `id-token: write`
26+
# on the calling job. The reusable re-asserts these on its own
27+
# `analysis` job, but called-workflow permissions are CAPPED by
28+
# the caller's permissions block.
29+
# - Caller keeps its own `on:` triggers and `concurrency:` group, so
30+
# the read-only cancel-superseded behaviour stays in the wrapper.
31+
#
32+
# Caller example (wrapper):
33+
# # SPDX-License-Identifier: PMPL-1.0-or-later
34+
# name: OSSF Scorecard
35+
# on:
36+
# push:
37+
# branches: [main, master]
38+
# schedule:
39+
# - cron: '0 4 * * *'
40+
# workflow_dispatch:
41+
# concurrency:
42+
# group: ${{ github.workflow }}-${{ github.ref }}
43+
# cancel-in-progress: true
44+
# permissions:
45+
# contents: read
46+
# jobs:
47+
# scorecard:
48+
# permissions:
49+
# security-events: write
50+
# id-token: write
51+
# uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@<sha>
52+
53+
name: Scorecard (reusable)
54+
55+
on:
56+
workflow_call:
57+
inputs:
58+
runs-on:
59+
description: Runner label
60+
type: string
61+
required: false
62+
default: ubuntu-latest
63+
64+
permissions:
65+
contents: read
66+
67+
jobs:
68+
analysis:
69+
runs-on: ${{ inputs.runs-on }}
70+
permissions:
71+
security-events: write
72+
id-token: write
73+
steps:
74+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
75+
with:
76+
persist-credentials: false
77+
78+
- name: Run Scorecard
79+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.3.1
80+
with:
81+
results_file: results.sarif
82+
results_format: sarif
83+
84+
- name: Upload results
85+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3.31.8
86+
with:
87+
sarif_file: results.sarif

0 commit comments

Comments
 (0)