Skip to content

Commit bb8a8af

Browse files
authored
fix(ci): run changeset release as bombshell-bot app (#123)
* fix(ci): run changeset release as bombshell-bot app The Publish workflow passed the default `secrets.GITHUB_TOKEN` to `changesets/action`, so the "Version Packages" PR, the version-bump commit, and the release tag were all attributed to `github-actions[bot]` instead of our `bombshell-bot` GitHub App like the other Bombshell repos. Mint an installation token from the org-level `BOT_APP_ID` / `BOT_PRIVATE_KEY` secrets via `actions/create-github-app-token`, check out with it so the persisted git credentials push as the app, set the git user to the app identity so the bump commit is authored by it, and hand the token to `changesets/action` so it opens the PR as the app. tty can't reuse `bombshell-dev/automation`'s publish workflow (that one builds with pnpm/Node; tty builds WASM via make + Deno), so the app-token pattern is inlined here. `push-with-git-cli: true` stays because the clay submodule gitlink breaks the GitHub-API push path (0e10dcd), which is also why the git-user config is needed for commit authorship. * Apply suggestion from @natemoo-re * Apply suggestion from @natemoo-re
1 parent 0e10dcd commit bb8a8af

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,25 @@ jobs:
1919
pull-requests: write # open the "Version Packages" PR
2020
id-token: write # npm publish via OIDC trusted publishing
2121
steps:
22+
- name: generate bot token
23+
id: bot-token
24+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
25+
with:
26+
app-id: ${{ secrets.BOT_APP_ID }}
27+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
28+
2229
- name: checkout
2330
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2431
with:
2532
submodules: true
2633
fetch-depth: 0
34+
persist-credentials: true
35+
token: ${{ steps.bot-token.outputs.token }}
36+
37+
- name: setup git user
38+
run: |
39+
git config --global user.name "bombshell-bot[bot]"
40+
git config --global user.email "187071675+bombshell-bot[bot]@users.noreply.github.com"
2741
2842
- name: setup deno
2943
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5
@@ -54,5 +68,4 @@ jobs:
5468
pr-title: "chore: version packages"
5569
create-github-releases: false
5670
push-with-git-cli: true
57-
env:
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
github-token: ${{ steps.bot-token.outputs.token }}

0 commit comments

Comments
 (0)