16 Commits

Author SHA1 Message Date
97e07611e9 fix: rename commitlint.config.js to .cjs for ESM compatibility
wagoid/commitlint-github-action v6.2.1 runs with "type": "module"
in package.json, causing .js files to be treated as ESM. The
module.exports syntax requires CommonJS, so rename to .cjs.
2026-03-15 04:22:18 -07:00
885c1415fd fix: correct wagoid/commitlint-github-action pinned SHA for v6
The previous SHA b948419...cb3d was invalid (404 on GitHub API).
Updated to the actual v6 tag commit: b948419...f3ed.
2026-03-15 04:20:59 -07:00
3ecfe2176c docs: document template-vars consumer overrides for GitHub App
Update README:
- Bump minimum common-repo version to 0.28.4
- Add 'Using a different GitHub App' section with override example
- Note release.yaml sync exception in repo structure
2026-03-15 04:19:06 -07:00
e862130db5 feat: restore template vars for GitHub App customization
All upstream blockers resolved:
- common-repo/common-repo#235: source-declared template-vars passthrough (0.28.0)
- common-repo/common-repo#239: ${{ }} GHA expression collision fix (0.28.3)
- common-repo/common-repo#249: consumer override cache key fix (0.28.4)

Requires common-repo >= 0.28.4.

CI sync check skips release.yaml since src/ uses template vars
while top-level uses hardcoded christmas-island defaults.

Consumers can override GH App credentials:
```yaml
- repo:
    url: https://github.com/christmas-island/cr-semantic-release
    ref: v2.0.0
    with:
      - template-vars:
          GH_APP_ID_VAR: MY_APP_ID
          GH_APP_KEY_SECRET: MY_APP_KEY
          GH_APP_OWNER: my-org
```
2026-03-15 04:18:40 -07:00
semantic-release-bot
884e7b717f chore(release): 1.2.1 [skip ci]
## [1.2.1](https://github.com/christmas-island/cr-semantic-release/compare/v1.2.0...v1.2.1) (2026-03-15)

### Bug Fixes

* revert template vars — GHA ${{ }} collides with ${} template syntax ([e4a8514](e4a8514405)), closes [common-repo/common-repo#TBD](https://github.com/common-repo/common-repo/issues/TBD)
2026-03-15 09:41:21 +00:00
e4a8514405 fix: revert template vars — GHA ${{ }} collides with ${} template syntax
common-repo's template engine matches ${...} inside ${{ }}
GitHub Actions expressions, causing 'Undefined variable' errors.
Need escape mechanism or smarter regex (common-repo/common-repo#TBD).

Revert to hardcoded christmas-island values for now.
2026-03-15 02:40:48 -07:00
7b4ed7f7bb Revert "revert: remove template vars until common-repo/common-repo#235 lands"
This reverts commit 529f26bad9.
2026-03-15 02:15:50 -07:00
semantic-release-bot
344d38c071 chore(release): 1.2.0 [skip ci]
## [1.2.0](https://github.com/christmas-island/cr-semantic-release/compare/v1.1.0...v1.2.0) (2026-03-15)

### Documentation

* clean up README now that source filtering works on >=0.28.0 ([58003db](58003db568))

### Features

* templatize GitHub App vars in release workflow ([402ea38](402ea389ee))

### Bug Fixes

* template glob should use post-rename path ([6345772](63457723cc))
* template mark must use pre-rename path, move before rename ([d41cb34](d41cb341b4))
2026-03-15 09:09:32 +00:00
529f26bad9 revert: remove template vars until common-repo/common-repo#235 lands
Source-declared template/template-vars not yet supported upstream.
Hardcode christmas-island app values for now.
2026-03-15 02:09:07 -07:00
d41cb341b4 fix: template mark must use pre-rename path, move before rename 2026-03-15 02:05:40 -07:00
63457723cc fix: template glob should use post-rename path 2026-03-15 02:04:01 -07:00
402ea389ee feat: templatize GitHub App vars in release workflow 2026-03-15 02:03:41 -07:00
58003db568 docs: clean up README now that source filtering works on >=0.28.0 2026-03-15 01:49:30 -07:00
semantic-release-bot
8ca7ff362d chore(release): 1.1.0 [skip ci]
## [1.1.0](https://github.com/christmas-island/cr-semantic-release/compare/v1.0.1...v1.1.0) (2026-03-15)

### Documentation

* update usage for common-repo 0.27.0 workaround ([e99caf6](e99caf6145)), closes [common-repo/common-repo#229](https://github.com/common-repo/common-repo/issues/229) [#230](https://github.com/christmas-island/cr-semantic-release/issues/230)

### Features

* restore source-declared filtering (requires common-repo >=0.28.0) ([8ba5ad3](8ba5ad3b43))
2026-03-15 08:49:05 +00:00
8ba5ad3b43 feat: restore source-declared filtering (requires common-repo >=0.28.0)
Source .common-repo.yaml includes only src/ and renames to root.
Consumers just need: repo: url + ref, no with: clause needed.
2026-03-15 01:48:33 -07:00
e99caf6145 docs: update usage for common-repo 0.27.0 workaround
Source-declared filtering is broken (common-repo/common-repo#229).
Consumer must use with: clause with include + rename for now.
Also documents rename uses $1 not %[1]s (#230).
2026-03-15 01:42:14 -07:00
9 changed files with 87 additions and 32 deletions

13
.common-repo.yaml Normal file
View File

@@ -0,0 +1,13 @@
# Source-level config: only expose src/ contents, renamed to root.
- include:
- "src/**"
- "src/.*"
- "src/.*/**"
- template:
- "src/.github/workflows/release.yaml"
- template-vars:
GH_APP_ID_VAR: CHRISTMAS_ISLAND_APP_ID
GH_APP_KEY_SECRET: CHRISTMAS_ISLAND_PRIVATE_KEY
GH_APP_OWNER: christmas-island
- rename:
- "^src/(.*)$": "$1"

View File

@@ -16,7 +16,7 @@ jobs:
run: | run: |
# Verify distributed files in src/ match the repo's own copies # Verify distributed files in src/ match the repo's own copies
status=0 status=0
for file in .releaserc.yaml commitlint.config.js; do for file in .releaserc.yaml commitlint.config.cjs; do
if ! diff -q "$file" "src/$file" > /dev/null 2>&1; then if ! diff -q "$file" "src/$file" > /dev/null 2>&1; then
echo "❌ $file differs from src/$file" echo "❌ $file differs from src/$file"
diff --color "$file" "src/$file" || true diff --color "$file" "src/$file" || true
@@ -25,7 +25,7 @@ jobs:
echo "✅ $file matches src/$file" echo "✅ $file matches src/$file"
fi fi
done done
for file in .github/workflows/commitlint.yml .github/workflows/release.yaml; do for file in .github/workflows/commitlint.yml; do
if ! diff -q "$file" "src/$file" > /dev/null 2>&1; then if ! diff -q "$file" "src/$file" > /dev/null 2>&1; then
echo "❌ $file differs from src/$file" echo "❌ $file differs from src/$file"
diff --color "$file" "src/$file" || true diff --color "$file" "src/$file" || true
@@ -34,6 +34,8 @@ jobs:
echo "✅ $file matches src/$file" echo "✅ $file matches src/$file"
fi fi
done done
# release.yaml intentionally differs: src/ uses template vars, top-level uses hardcoded defaults
echo "⏭️ .github/workflows/release.yaml skipped (template vars in src/)"
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo "" echo ""
echo "Top-level files and src/ are out of sync." echo "Top-level files and src/ are out of sync."

View File

@@ -17,4 +17,4 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548c61b7286b4ffe7cb3d # v6 - uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6

View File

@@ -1,3 +1,34 @@
## [1.2.1](https://github.com/christmas-island/cr-semantic-release/compare/v1.2.0...v1.2.1) (2026-03-15)
### Bug Fixes
* revert template vars — GHA ${{ }} collides with ${} template syntax ([e4a8514](https://github.com/christmas-island/cr-semantic-release/commit/e4a8514405acb48c8dcd5be8df63fa8c67f57384)), closes [common-repo/common-repo#TBD](https://github.com/common-repo/common-repo/issues/TBD)
## [1.2.0](https://github.com/christmas-island/cr-semantic-release/compare/v1.1.0...v1.2.0) (2026-03-15)
### Documentation
* clean up README now that source filtering works on >=0.28.0 ([58003db](https://github.com/christmas-island/cr-semantic-release/commit/58003db568089843a5727a896cbb7b250e0f32ba))
### Features
* templatize GitHub App vars in release workflow ([402ea38](https://github.com/christmas-island/cr-semantic-release/commit/402ea389ee69ad21a40ad1a7d5d144324672fc72))
### Bug Fixes
* template glob should use post-rename path ([6345772](https://github.com/christmas-island/cr-semantic-release/commit/63457723cc0c26fbb1d17c5cf333b68f01ff991f))
* template mark must use pre-rename path, move before rename ([d41cb34](https://github.com/christmas-island/cr-semantic-release/commit/d41cb341b463f24c6fe3891af16fb7354f92a956))
## [1.1.0](https://github.com/christmas-island/cr-semantic-release/compare/v1.0.1...v1.1.0) (2026-03-15)
### Documentation
* update usage for common-repo 0.27.0 workaround ([e99caf6](https://github.com/christmas-island/cr-semantic-release/commit/e99caf614571bb35b4a95c44dcd7f94011074bac)), closes [common-repo/common-repo#229](https://github.com/common-repo/common-repo/issues/229) [#230](https://github.com/christmas-island/cr-semantic-release/issues/230)
### Features
* restore source-declared filtering (requires common-repo >=0.28.0) ([8ba5ad3](https://github.com/christmas-island/cr-semantic-release/commit/8ba5ad3b433fd5edbd13c8c9452f77ea914869bd))
## [1.0.1](https://github.com/christmas-island/cr-semantic-release/compare/v1.0.0...v1.0.1) (2026-03-15) ## [1.0.1](https://github.com/christmas-island/cr-semantic-release/compare/v1.0.0...v1.0.1) (2026-03-15)
### Miscellaneous ### Miscellaneous

View File

@@ -15,28 +15,19 @@ Files distributed from `src/`:
## Usage ## Usage
### Add to a new repo > **Requires common-repo ≥ 0.28.4** for source-declared filtering and template variable overrides.
```bash
cr init https://github.com/christmas-island/cr-semantic-release
```
### Add to an existing `.common-repo.yaml` ### Add to an existing `.common-repo.yaml`
```bash
cr add https://github.com/christmas-island/cr-semantic-release
```
Or manually:
```yaml ```yaml
# .common-repo.yaml # .common-repo.yaml
- repo: - repo:
url: https://github.com/christmas-island/cr-semantic-release url: https://github.com/christmas-island/cr-semantic-release
ref: v1.0.0 ref: v1.1.0
path: src/
``` ```
That's it. The source repo's `.common-repo.yaml` handles scoping to `src/` and stripping the prefix.
### Apply ### Apply
```bash ```bash
@@ -48,6 +39,7 @@ cr apply # apply
``` ```
cr-semantic-release/ cr-semantic-release/
├── .common-repo.yaml ← source-declared filtering (include src/, rename to root)
├── .github/workflows/ ← this repo's own CI (dogfooding) ├── .github/workflows/ ← this repo's own CI (dogfooding)
│ ├── ci.yaml ← sync check: top-level == src/ │ ├── ci.yaml ← sync check: top-level == src/
│ ├── commitlint.yml ← commit linting for this repo │ ├── commitlint.yml ← commit linting for this repo
@@ -56,7 +48,7 @@ cr-semantic-release/
├── commitlint.config.js ← this repo's own commitlint ├── commitlint.config.js ← this repo's own commitlint
├── README.md ├── README.md
├── LICENSE ├── LICENSE
└── src/ ← distributed to consumers via path: src/ └── src/ ← distributed to consumers
├── .github/workflows/ ├── .github/workflows/
│ ├── commitlint.yml │ ├── commitlint.yml
│ └── release.yaml │ └── release.yaml
@@ -64,19 +56,36 @@ cr-semantic-release/
└── commitlint.config.js └── commitlint.config.js
``` ```
The top-level files and `src/` files are identical — the repo eats its own dog food. CI enforces they stay in sync. The top-level files and `src/` files are identical — the repo eats its own dog food. CI enforces they stay in sync (except `release.yaml`, which uses template variables in `src/` and hardcoded defaults at the top level).
## Prerequisites ## Prerequisites
The release workflow expects the following GitHub org-level vars and secrets: By default, the release workflow uses these GitHub org-level vars and secrets:
| Name | Type | Purpose | | Name | Type | Default | Purpose |
|---|---|---| |---|---|---|---|
| `CHRISTMAS_ISLAND_APP_ID` | Variable | GitHub App ID for generating tokens | | `CHRISTMAS_ISLAND_APP_ID` | Variable | — | GitHub App ID for generating tokens |
| `CHRISTMAS_ISLAND_PRIVATE_KEY` | Secret | GitHub App private key | | `CHRISTMAS_ISLAND_PRIVATE_KEY` | Secret | — | GitHub App private key |
These are used by `actions/create-github-app-token` to generate a token with write permissions for creating releases and pushing tags/changelogs. These are used by `actions/create-github-app-token` to generate a token with write permissions for creating releases and pushing tags/changelogs.
### Using a different GitHub App
Override the template variables in your consumer config to use your own app credentials:
```yaml
- repo:
url: https://github.com/christmas-island/cr-semantic-release
ref: v2.0.0
with:
- template-vars:
GH_APP_ID_VAR: MY_APP_ID # GitHub vars name
GH_APP_KEY_SECRET: MY_APP_KEY # GitHub secrets name
GH_APP_OWNER: my-org # App installation owner
```
This renders the workflow with `${{ vars.MY_APP_ID }}`, `${{ secrets.MY_APP_KEY }}`, and `owner: my-org`.
## Customization ## Customization
### Release workflow ### Release workflow
@@ -92,10 +101,11 @@ If you only want a subset:
```yaml ```yaml
- repo: - repo:
url: https://github.com/christmas-island/cr-semantic-release url: https://github.com/christmas-island/cr-semantic-release
ref: v1.0.0 ref: v1.1.0
path: src/
with: with:
- exclude: [".github/workflows/commitlint.yml"] - include: ["src/.releaserc.yaml", "src/commitlint.config.js"]
- rename:
- "^src/(.*)$": "$1"
``` ```
### Overriding `.releaserc.yaml` ### Overriding `.releaserc.yaml`
@@ -105,8 +115,7 @@ Use common-repo's YAML merge operator to patch specific fields:
```yaml ```yaml
- repo: - repo:
url: https://github.com/christmas-island/cr-semantic-release url: https://github.com/christmas-island/cr-semantic-release
ref: v1.0.0 ref: v1.1.0
path: src/
- yaml: - yaml:
source: my-releaserc-overrides.yaml source: my-releaserc-overrides.yaml
dest: .releaserc.yaml dest: .releaserc.yaml

View File

@@ -17,4 +17,4 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548c61b7286b4ffe7cb3d # v6 - uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6

View File

@@ -32,9 +32,9 @@ jobs:
id: app-token id: app-token
uses: actions/create-github-app-token@v1 uses: actions/create-github-app-token@v1
with: with:
app-id: ${{ vars.CHRISTMAS_ISLAND_APP_ID }} app-id: ${{ vars.${GH_APP_ID_VAR:-CHRISTMAS_ISLAND_APP_ID} }}
private-key: ${{ secrets.CHRISTMAS_ISLAND_PRIVATE_KEY }} private-key: ${{ secrets.${GH_APP_KEY_SECRET:-CHRISTMAS_ISLAND_PRIVATE_KEY} }}
owner: christmas-island owner: ${GH_APP_OWNER:-christmas-island}
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
fetch-depth: 0 fetch-depth: 0