From 449341219066727bd585cf37fda93d6a314944b6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 23:48:34 +0000 Subject: [PATCH] ci(workflow-linter): look for SPDX in the leading comment block The "Check SPDX headers" step only read line 1 of each workflow. Dependabot's actions-lock bumps now prepend "# This workflow is managed by gh actions-lock." above the existing header, so every workflow's SPDX line sits on line 2 or later and lint-workflows fails on main ("missing SPDX header", one error per file). Moving the SPDX line back to the top would last only until the next Dependabot bump. The check now accepts an SPDX-License-Identifier anywhere in the leading block of comment and blank lines, before the first YAML line. A file whose only SPDX line comes after YAML content, or that has none, still fails. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0132Cdz3iwk2QGKv2sUhhsye --- .github/workflows/workflow-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml index 38b9a2f..9453d41 100644 --- a/.github/workflows/workflow-linter.yml +++ b/.github/workflows/workflow-linter.yml @@ -27,7 +27,7 @@ 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 + if ! awk '/^[[:space:]]*(#|$)/ { if (/SPDX-License-Identifier/) found = 1; next } { exit } END { exit !found }' "$f"; then echo "ERROR: $f missing SPDX header" errors=$((errors + 1)) fi