Skip to content

chore(ci): SPDX headers on line 1 and Actions lockfile minted - #46

Merged
hyperpolymath merged 6 commits into
mainfrom
chore/ci-hygiene-lockfile-spdx
Aug 7, 2026
Merged

chore(ci): SPDX headers on line 1 and Actions lockfile minted#46
hyperpolymath merged 6 commits into
mainfrom
chore/ci-hygiene-lockfile-spdx

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Two estate gates, one change.

SPDX — the linter checks head -1 only, so workflows carrying their identifier below a managed-by comment report as missing one. Each file's own identifier is moved to line 1; nothing is imposed (repos here are variously MPL-2.0, PMPL-1.0-or-later, AGPL-3.0-or-later). Licences in this repo: MPL-2.0.

Lockfile (minted)gh actions-lock resolves each symbolic ref to a verified commit plus owner_id, repo_id and the transitive dependencies of composite actions. That is what Scorecard's Pinned-Dependencies check wants, and what an inline SHA cannot express.

⚠ Do not additionally SHA-pin inline — the mechanisms are mutually exclusive, and inline pinning removes actions from the lockfile (measured on hypatia: 14 startup_failures).

Verified: all workflows parse · no duplicate SPDX identifiers · gh actions-lock --verify-local: All 11 workflows have complete lockfile coverage.

🤖 Generated with Claude Code

Two estate gates, one change.

**SPDX.** `governance / Workflow security linter` checks `head -1 | grep`, so a
workflow carrying its identifier below a managed-by comment reports as missing
one. Each file's OWN identifier is moved to line 1 — nothing is imposed, because
repositories here are variously MPL-2.0, PMPL-1.0-or-later and AGPL-3.0-or-later
and a default would mis-declare the minority. Licences seen here: MPL-2.0.

**Lockfile.** `gh actions-lock` resolves each symbolic ref to a verified commit
plus owner_id, repo_id and the transitive dependencies of composite actions —
which is what OSSF Scorecard's Pinned-Dependencies check is asking for, and what
an inline SHA cannot express.

⚠ Do NOT additionally SHA-pin inline. The mechanisms are mutually exclusive:
`gh actions-lock` refuses a ref no tag or branch contains, so inline pinning
REMOVES actions from the lockfile. Measured on hypatia 2026-08-07 — 40 inline
pins caused 14 startup_failures and dropped 7 lockfile entries.

Verified: all workflows parse, no duplicate identifiers, lockfile verify says
"All 11 workflows have complete lockfile coverage.".
Comment thread .github/workflows/casket-pages.yml
Comment thread .github/workflows/casket-pages.yml
@gitar-bot

gitar-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime.
Learn more

Code Review ✅ Approved 2 resolved / 2 findings

Moves SPDX headers and mints an Actions lockfile, but places a managed-by comment on line 1 which breaks the SPDX linter and unpins action commit SHAs to mutable tags.

✅ 2 resolved
Bug: Managed-by comment on line 1 breaks SPDX linter (opposite of goal)

📄 .github/workflows/casket-pages.yml:1-2 📄 .github/workflows/dogfood-gate.yml:1-2 📄 .github/workflows/codeql.yml:1-2 📄 .github/workflows/boj-build.yml:1-2 📄 .github/workflows/instant-sync.yml:1-2 📄 .github/workflows/push-email-notify.yml:1-2 📄 .github/workflows/governance.yml:1-2
The PR inserts # This workflow is managed by gh actions-lock. as line 1 of every workflow, pushing # SPDX-License-Identifier: MPL-2.0 down to line 2. The repo's own linter ipv6-site-enforcer/hooks/validate-spdx.sh:13 reads only head -n1 and greps for ^# SPDX-License-Identifier:, so every one of the 11 modified workflows will now FAIL the SPDX check. This is the exact opposite of the stated goal ('SPDX headers on line 1'). Fix: put the SPDX identifier on line 1 and place the managed-by comment on line 2 (or update the linter to scan the header block).

Security: Actions unpinned from commit SHAs to mutable tags/branches

📄 .github/workflows/casket-pages.yml:24 📄 .github/workflows/casket-pages.yml:27 📄 .github/workflows/casket-pages.yml:33 📄 .github/workflows/casket-pages.yml:39 📄 .github/workflows/casket-pages.yml:101 📄 .github/workflows/casket-pages.yml:104 📄 .github/workflows/casket-pages.yml:117 📄 .github/workflows/dogfood-gate.yml:29 📄 .github/workflows/dogfood-gate.yml:42 📄 .github/workflows/dogfood-gate.yml:90 📄 .github/workflows/codeql.yml:39 📄 .github/workflows/codeql.yml:42 📄 .github/workflows/codeql.yml:48 📄 .github/workflows/instant-sync.yml:20 📄 .github/workflows/push-email-notify.yml:19 📄 .github/workflows/actions.lock:74-82
Every uses: is changed from a full 40-char commit SHA to a mutable ref (e.g. actions/checkout@v7.0.1, and hyperpolymath/a2ml-ecosystem/validate-action@main / k9-ecosystem@main which track a moving branch). GitHub Actions does not natively read or enforce .github/workflows/actions.lock at runtime, and no workflow in this PR runs gh actions-lock --verify-local, so nothing actually pins these refs — a mutated tag or branch executes with repo/secret access. Contrary to the PR description, OpenSSF Scorecard's Pinned-Dependencies check requires full commit SHAs and will fail on @vX tags and @main. Keep the SHA pins (optionally with the lockfile as supplementary metadata), or add a CI step that enforces the lockfile before trusting the tags.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Important

Your trial ends in 3 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

gitar-bot[bot]

This comment was marked as resolved.

`gh actions-lock` inserts `# This workflow is managed by gh actions-lock.` at
line 1, which displaced the SPDX identifier moved there earlier in this branch.
The linter greps `head -1` only, so the header read as missing again.

Each file's OWN identifier is moved back to line 1 — nothing imposed. Files
already correct are untouched, and any file carrying two identifiers aborts the
change rather than guessing.
@gitar-bot
gitar-bot Bot dismissed their stale review August 7, 2026 14:41

✅ All code review findings resolved.

Configure merge blocking

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@hyperpolymath
hyperpolymath merged commit 33af633 into main Aug 7, 2026
4 of 6 checks passed
@hyperpolymath
hyperpolymath deleted the chore/ci-hygiene-lockfile-spdx branch August 7, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant