|
1 | | -# SPDX-License-Identifier: MPL-2.0 |
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: MPL-2.0 |
34 | | -# name: OSSF Scorecard |
35 | | -# on: |
36 | | -# push: |
37 | | -# branches: [main, master] |
38 | | -# schedule: |
39 | | -# - cron: '23 4 * * 1' # Weekly (Monday 04:23 UTC) — match canonical |
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 | | -# CANONICAL SCHEDULE — WEEKLY, NOT DAILY (2026-05-28). |
54 | | -# Estate audit found 180 repos running daily at 04:00 UTC ('0 4 * * *') |
55 | | -# vs 29 on canonical weekly ('23 4 * * 1') — drift driven by an older |
56 | | -# version of the example above. Downstream thin-caller wrappers should |
57 | | -# keep the weekly cadence shown above. |
58 | | -# |
59 | | -# NOTE (2026-06-04): the standards repo itself no longer ships a thin |
60 | | -# `scorecard.yml` caller — it was retired in #372 as a redundant second |
61 | | -# scorecard run. Standards runs OSSF Scorecard directly via |
62 | | -# `scorecard-enforcer.yml` (weekly, Monday 06:00 UTC; publishes + gates |
63 | | -# on MIN_SCORE). This reusable is UNCHANGED and downstream callers are |
64 | | -# unaffected — they remain the canonical thin-caller pattern. |
65 | | -# |
66 | | -# GH Actions budget impact of the drift: 180 daily × (365 − 52) ≈ 56k |
67 | | -# extra runs/year × ~1.5 min/run ≈ ~84k Actions-minutes/year. Fan-out |
68 | | -# to convert the 180 estate repos from daily→weekly is tracked |
69 | | -# separately (GH-Actions budget rebalancing 2026-05-27). |
70 | | -# |
71 | | -# When to deviate: a repo with a very high merge/push cadence AND |
72 | | -# scorecard-sensitive supply-chain churn (heavy dependency refresh) |
73 | | -# MAY opt into more frequent runs. Daily is rarely worth it; the |
74 | | -# scorecard signal moves on the order of weeks, not hours. |
75 | | - |
76 | | -name: Scorecard (reusable) |
| 1 | +# SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +name: OSSF Scorecard Reusable Workflow |
77 | 3 |
|
78 | 4 | on: |
79 | 5 | workflow_call: |
80 | | - inputs: |
81 | | - runs-on: |
82 | | - description: Runner label |
83 | | - type: string |
84 | | - required: false |
85 | | - default: ubuntu-latest |
86 | 6 |
|
87 | 7 | permissions: |
88 | 8 | contents: read |
89 | 9 |
|
90 | 10 | jobs: |
91 | | - analysis: |
92 | | - timeout-minutes: 20 |
93 | | - runs-on: ${{ inputs.runs-on }} |
| 11 | + scorecard: |
| 12 | + name: Run Scorecard |
| 13 | + runs-on: ubuntu-latest |
94 | 14 | permissions: |
95 | 15 | security-events: write |
96 | 16 | id-token: write |
97 | 17 | steps: |
98 | | - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
99 | 20 | with: |
100 | 21 | persist-credentials: false |
101 | 22 |
|
102 | | - - name: Run Scorecard |
103 | | - uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.3.1 |
| 23 | + - name: Run Scorecard Analysis |
| 24 | + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 |
104 | 25 | with: |
105 | | - results_file: results.sarif |
106 | | - results_format: sarif |
| 26 | + results_file: results.json |
| 27 | + results_format: json |
| 28 | + publish_results: true |
107 | 29 |
|
108 | | - - name: Upload results |
109 | | - uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v3.31.8 |
| 30 | + - name: Upload results artifact |
| 31 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
110 | 32 | with: |
111 | | - sarif_file: results.sarif |
| 33 | + name: scorecard-results |
| 34 | + path: results.json |
| 35 | + retention-days: 90 |
0 commit comments