Add SPDX license header tooling for OSRB compliance - #619
Conversation
|
✅ Deploy Preview for gregarious-clafoutis-525547 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR introduces an automated SPDX license-header enforcement mechanism for the repository, wiring it into local developer workflows (Husky) and CI (GitHub Actions) and adding a standalone COPYRIGHT.md marker file.
Changes:
- Add
tools/license-header.jsto insert/normalize SPDX headers, with--checkand--stagedmodes. - Add npm scripts (
license,license-check,license-staged) and runlicense-stagedin the pre-commit hook. - Add a GitHub Actions workflow to enforce SPDX headers on changed files, plus add
COPYRIGHT.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/license-header.js | New script to insert/validate canonical SPDX headers across source roots. |
| package.json | Adds scripts to run the license header tool in fix/check/staged modes. |
| COPYRIGHT.md | Adds repository-level SPDX copyright/license marker text. |
| .husky/pre-commit | Runs license header normalization on staged files before other pre-commit steps. |
| .github/workflows/license.yml | Adds CI job to verify SPDX headers on changed files for PRs/pushes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MikeKingdom
left a comment
There was a problem hiding this comment.
Looks good. I think a few of Copilot's comments are worth cleaning up.
Same. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/license.yml:7
- The PR description says the CI gate runs on pushes to master/stable, but this workflow only triggers for the master branch. If stable is meant to be gated too, add it to the branch filters (or update the PR description if stable is intentionally excluded).
pull_request:
branches: [master]
push:
branches: [master]
tools/license-header.js:116
- File processing order depends on filesystem traversal order, so the list of non-compliant files (and even which file is rewritten first) can vary run-to-run/OS-to-OS. Sorting the collected file list makes CI output deterministic and reduces noisy diffs/logs.
let files;
Addressed |

What does this PR do?
license-header.js- dependency-free Node script that adds/validates the canonical SPDX header across source files (yarn license to fix, yarn license-check to verify). Rebuilds headers so it also corrects drift, and preserves shebangs.license.yml- CI gate running license-check on PRs and pushes to master.COPYRIGHT.md- updated to the canonical SPDX header format.packaga.jsonWhat testing has been done on this PR?
Any background context you want to provide?
What are the relevant issues?
relates to grommet/hpe-design-system#6360
Screenshots (if appropriate)
Is this change backward compatible or could it be a breaking change for the official HPE theme?
How should this PR be communicated in the release notes?