From 0518b51cf73e09c7909e98ed97a11fde76f0ef1b Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 7 Oct 2026 00:15:00 +0100 Subject: [PATCH] fix(ci): accept the SPDX header anywhere in the leading comment block gh actions-lock (#179) prepends "# This workflow is managed by gh actions-lock." to every workflow, so line 1 is no longer the licence and the lint-workflows "Check SPDX headers" step failed on all 16 workflows (exit 16). Adopt the rsr-template-repo check: the SPDX-License-Identifier line must still appear, but anywhere in the leading comment block before the workflow body. A workflow with no SPDX line, or with it only after the body starts, still fails. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01X3hgXxWm6umMgZkjYyHnnm --- .github/workflows/workflow-linter.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml index bace5a1..93e994d 100644 --- a/.github/workflows/workflow-linter.yml +++ b/.github/workflows/workflow-linter.yml @@ -27,7 +27,10 @@ jobs: errors=0 for f in .github/workflows/*.yml .github/workflows/*.yaml; do [ -f "$f" ] || continue - if ! head -1 "$f" | grep -q "SPDX-License-Identifier"; then + # gh actions-lock prepends its own comment, so line 1 is no + # longer the licence. Require the licence in the leading + # comment block, before the workflow body (as rsr-template-repo). + if ! awk '/^# SPDX-License-Identifier:/ { found=1 } /^[^#[:space:]]/ { exit } END { exit !found }' "$f"; then echo "ERROR: $f missing SPDX header" errors=$((errors + 1)) fi