chore: enforce Apache license headers with google/addlicense - #1129
Merged
Conversation
Adds a license job to the validate workflow that runs google/addlicense in check mode over tracked ts/js files. Run npm run license:fix locally to add missing headers. Pins workflow actions to commit SHAs and restricts the workflow token to read-only, per zizmor policy. Claude-Session: https://claude.ai/code/session_013dz9GhC3metut6HFswPavu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds google/addlicense enforcement for Apache 2.0 license headers on tracked
.ts/.jsfiles. Mirrors firebase/extensions#2928.license-header.tmpl: header template matching the repo's existing header wording (https URL variant)scripts/addlicense.sh: shared check/fix entrypoint usinggit ls-files(NUL-safe, excludes node_modules, lib, dist, coverage and untracked files, rejects unknown modes)npm run license:check/npm run license:fixroot scriptslicensejob in the validate workflow, pinned to addlicense v1.2.0, runs on every PR (~30s, no npm install needed)permissions: contents: read, required by the zizmor mandatory checks that run once a workflow file is touched (checkout bumped v2 -> v3.6.0, setup-node v2-beta -> v3.8.1)Testing
./scripts/addlicense.sh checkexits 0 after backfillnpm run lint(gts) problem count identical to main baseline (558 pre-existing), one prettier nit introduced by header insertion into an empty file was auto-fixedtext-to-speech/functionstsc build passes with headers in placehttps://claude.ai/code/session_013dz9GhC3metut6HFswPavu