Skip to content

ci(workflow-linter): look for SPDX in the leading comment block - #141

Merged
hyperpolymath merged 1 commit into
mainfrom
ci/spdx-header-check
Nov 5, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
ci/spdx-header-check

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What was wrong

lint-workflows fails on main with ERROR: .github/workflows/<file>.yml missing SPDX header for all 20 workflows (exit code 20). The SPDX check reads only line 1. Dependabot's actions-lock bumps (from #136 on) prepend # This workflow is managed by gh actions-lock. above the existing header, so every SPDX line is now on line 2 or later. Moving it back to the top would only last until the next bump.

Change

workflow-linter.yml: the "Check SPDX headers" step 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, or that has none, still fails.

Testing

I ran the step scripts locally against this branch:

  • SPDX check: exit 0 (was 20).
  • Permissions check: exit 0.
  • Negative test: a file with no SPDX header and a file with SPDX after name: both fail; a file with SPDX after a blank line and another comment passes.

Generated by Claude Code

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0132Cdz3iwk2QGKv2sUhhsye
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • SPDX header checks now accept identifiers found within the opening comment and blank lines of workflow files.

The workflow linter now searches the initial comment and blank lines of each workflow file for an SPDX identifier.

Changes: Workflow Linting

Layer / File(s) Summary
SPDX header scan
.github/workflows/workflow-linter.yml
The SPDX check searches the initial comment and blank lines for an identifier, rather than checking only the first line.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: Minimal · up to 44934

No actionable merge-blocking risk was identified in the workflow linter change.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title names the change: the workflow linter's SPDX check now scans the leading comment block. It matches the single file change in the summary and the stated objective. It uses the conventional co…
Description check Passed The description is directly related to the changeset. It explains the failure (SPDX check reads only line 1, and Dependabot's actions-lock bumps push the header lower), describes the new behaviour in …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: the workflow linter's SPDX check now scans the leading comment block. It matches the single file change in the summary and the stated objective. It uses the conventional commit prefix 'ci(workflow-linter)', which is acceptable. The title is 63 characters, within a normal length.

Full details: Description check

Explanation

The description is directly related to the changeset. It explains the failure (SPDX check reads only line 1, and Dependabot's actions-lock bumps push the header lower), describes the new behaviour in workflow-linter.yml, and reports local test results for the SPDX and permissions checks plus negative cases. It is specific enough to pass.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 64f2a4c0-b8ed-4b7c-9c45-66d5434d79ce
Commits

Reviewing files that changed from the base of the PR and between a328a17 and 4493412.

Files selected for processing: 1
  • .github/workflows/workflow-linter.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details
Context from checks skipped due to timeout: 6
  • GitHub Check: CodeRabbit
  • GitHub Check: analyze (javascript-typescript, none)
  • GitHub Check: attestation
  • GitHub Check: performance
  • GitHub Check: security
  • GitHub Check: semgrep-cloud-platform/scan
Additional comments: 1
.github/workflows/workflow-linter.yml: 1

30-30: LGTM!

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@linear-code
linear-code Bot marked this pull request as ready for review November 4, 2026 23:51
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@hyperpolymath
hyperpolymath merged commit fc1e90f into main Nov 5, 2026
21 checks passed
@hyperpolymath
hyperpolymath deleted the ci/spdx-header-check branch November 5, 2026 15:41
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.

2 participants