Skip to content

chore: enforce Apache license headers with google/addlicense - #1129

Merged
cabljac merged 2 commits into
mainfrom
chore/addlicense
Jul 30, 2026
Merged

chore: enforce Apache license headers with google/addlicense#1129
cabljac merged 2 commits into
mainfrom
chore/addlicense

Conversation

@cabljac

@cabljac cabljac commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds google/addlicense enforcement for Apache 2.0 license headers on tracked .ts/.js files. Mirrors firebase/extensions#2928.

  • Commit 1 backfills headers into 155 files that were missing them (mostly tests and jest configs, some src). Insertions only, no code changes. Files with existing headers are untouched and keep their original copyright years.
  • Commit 2 adds the tooling and CI:
    • license-header.tmpl: header template matching the repo's existing header wording (https URL variant)
    • scripts/addlicense.sh: shared check/fix entrypoint using git ls-files (NUL-safe, excludes node_modules, lib, dist, coverage and untracked files, rejects unknown modes)
    • npm run license:check / npm run license:fix root scripts
    • New license job in the validate workflow, pinned to addlicense v1.2.0, runs on every PR (~30s, no npm install needed)
    • Pins existing workflow actions to commit SHAs and adds 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 check exits 0 after backfill
  • npm 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-fixed
  • text-to-speech/functions tsc build passes with headers in place

https://claude.ai/code/session_013dz9GhC3metut6HFswPavu

cabljac added 2 commits July 30, 2026 09:17
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

@IzaakGough IzaakGough left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cabljac
cabljac merged commit 68ef3fa into main Jul 30, 2026
15 checks passed
@cabljac
cabljac deleted the chore/addlicense branch July 30, 2026 09:52
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