Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit f930b6b

Browse files
feat(build): integrate release-please bot with GitHub App auth and CI gating (#139)
* feat(build): add release-please bot with GitHub App auth and CI gating - merge release-please into main.yml gated behind all 6 CI jobs - add publish-release job to promote draft releases - upgrade release-please-action from v4.1.0 to v4.4.0 - add draft mode, search depths, emoji changelog headers to config - delete standalone release-please.yml 🤖 - Generated by Copilot * fix(build): add concurrency group and use App token for publish-release - add concurrency group to release-please and publish-release jobs - replace GITHUB_TOKEN with App token in publish-release job - downgrade publish-release permissions from contents:write to contents:read 🔧 - Generated by Copilot
1 parent b8da8a1 commit f930b6b

4 files changed

Lines changed: 86 additions & 45 deletions

File tree

.github/instructions/commit-message.instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Scopes MUST be one of the following:
3737
- `(scripts)`
3838
- `(src)`
3939
- `(deploy)`
40+
- `(build)`
4041

4142
## Description
4243

.github/workflows/main.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,77 @@ jobs:
5252
uses: ./.github/workflows/markdown-link-check.yml
5353
permissions:
5454
contents: read
55+
56+
# Automated release PR management via release-please
57+
release-please:
58+
needs:
59+
- spell-check
60+
- markdown-lint
61+
- table-format
62+
- psscriptanalyzer
63+
- link-lang-check
64+
- markdown-link-check
65+
name: Release Please
66+
runs-on: ubuntu-latest
67+
concurrency:
68+
group: release-please-${{ github.ref }}
69+
cancel-in-progress: false
70+
permissions:
71+
contents: read
72+
outputs:
73+
release_created: ${{ steps.release.outputs.release_created }}
74+
tag_name: ${{ steps.release.outputs.tag_name }}
75+
version: ${{ steps.release.outputs.version }}
76+
major: ${{ steps.release.outputs.major }}
77+
minor: ${{ steps.release.outputs.minor }}
78+
patch: ${{ steps.release.outputs.patch }}
79+
steps:
80+
- name: Harden Runner
81+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.10.2
82+
with:
83+
egress-policy: audit
84+
85+
- name: Generate GitHub App Token
86+
id: app-token
87+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.0.0
88+
with:
89+
app-id: ${{ vars.RELEASE_APP_ID }}
90+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
91+
92+
- name: Run release-please
93+
id: release
94+
uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
95+
with:
96+
token: ${{ steps.app-token.outputs.token }}
97+
config-file: release-please-config.json
98+
manifest-file: release-please-manifest.json
99+
100+
# Promote draft release to published
101+
publish-release:
102+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
103+
needs: [release-please]
104+
name: Publish Release
105+
runs-on: ubuntu-latest
106+
concurrency:
107+
group: release-please-${{ github.ref }}
108+
cancel-in-progress: false
109+
permissions:
110+
contents: read
111+
steps:
112+
- name: Harden Runner
113+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.10.2
114+
with:
115+
egress-policy: audit
116+
117+
- name: Generate GitHub App Token
118+
id: app-token
119+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.0.0
120+
with:
121+
app-id: ${{ vars.RELEASE_APP_ID }}
122+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
123+
124+
- name: Publish draft release
125+
env:
126+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
127+
TAG_NAME: ${{ needs.release-please.outputs.tag_name }}
128+
run: gh release edit "$TAG_NAME" --draft=false --repo "$GITHUB_REPOSITORY"

.github/workflows/release-please.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

release-please-config.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"draft": true,
4+
"release-search-depth": 800,
5+
"commit-search-depth": 1000,
36
"packages": {
47
".": {
58
"release-type": "node",
@@ -12,14 +15,14 @@
1215
}
1316
],
1417
"changelog-sections": [
15-
{"type": "feat", "section": "Features", "hidden": false},
16-
{"type": "fix", "section": "Bug Fixes", "hidden": false},
17-
{"type": "docs", "section": "Documentation", "hidden": false},
18-
{"type": "refactor", "section": "Code Refactoring", "hidden": false},
19-
{"type": "perf", "section": "Performance", "hidden": false},
20-
{"type": "build", "section": "Build System", "hidden": false},
21-
{"type": "ops", "section": "Operations", "hidden": false},
22-
{"type": "chore", "section": "Miscellaneous", "hidden": false}
18+
{"type": "feat", "section": "Features", "hidden": false},
19+
{"type": "fix", "section": "🐛 Bug Fixes", "hidden": false},
20+
{"type": "docs", "section": "📚 Documentation", "hidden": false},
21+
{"type": "refactor", "section": "♻️ Code Refactoring", "hidden": false},
22+
{"type": "perf", "section": "Performance", "hidden": false},
23+
{"type": "build", "section": "📦 Build System", "hidden": false},
24+
{"type": "ops", "section": "🔧 Operations", "hidden": false},
25+
{"type": "chore", "section": "🔧 Miscellaneous", "hidden": false}
2326
],
2427
"bump-minor-pre-major": true,
2528
"bump-patch-for-minor-pre-major": false,

0 commit comments

Comments
 (0)