Legal Information Sync¶
The template includes an automated workflow that propagates copyright information across all repositories in the THD-Spatial-AI and enerplanet organizations. When the copyright holder is updated in this template, a pull request is automatically opened in every org repository with the change.
What gets synced¶
The following fields are updated — everything else in each file is left untouched:
| File | Field synced |
|---|---|
LICENSE |
Copyright holder line (license type and year preserved) |
mkdocs.yml |
copyright: field link text |
CITATION.cff |
affiliation: field(s) |
README.md |
Any Copyright (c) YEAR ... lines |
The copyright holder string is read directly from this template's LICENSE file, so it is always the single source of truth.
One-time setup¶
1. Create org-scoped fine-grained PATs¶
Create one token per organization. For each org (THD-Spatial-AI and enerplanet):
- Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token
- Set Resource owner to the organization (not your personal account)
- Set Repository access to All repositories
- Under Permissions → Repositories, add:
- Contents — Read and write
- Pull requests — Read and write
- Under Permissions → Organizations, add:
- Members — Read-only (required to list org repositories)
- Generate and copy the token
2. Add secrets to the template repo¶
In this template repo go to Settings → Secrets and variables → Actions → New repository secret and add:
| Secret name | Value |
|---|---|
SYNC_PAT_THD |
Token scoped to THD-Spatial-AI |
SYNC_PAT_ENERPLANET |
Token scoped to enerplanet |
Triggering the sync¶
Automatic¶
The workflow runs automatically on every push to main when any of these files change:
LICENSEmkdocs.ymlCITATION.cff
Manual (with dry-run)¶
Before finalizing legal text, use the dry-run mode to preview changes without creating PRs:
- Go to Actions → Sync Legal Information → Run workflow
- Check "Dry run — list changes without creating PRs"
- Click Run workflow
The log will show exactly which files would be updated in each repository. Once satisfied, run the workflow again without dry-run to open the PRs.
Opting out¶
Individual repositories can opt out by adding .github/.templatesync-ignore to their root:
Repositories that are archived or are forks are always skipped automatically.