From f6124ce3d5c50f94e1ca497ba9181a778e6d6c90 Mon Sep 17 00:00:00 2001 From: "Brett Adams (Firstmate)" Date: Fri, 6 Nov 2026 20:00:28 +1000 Subject: [PATCH 1/3] Push the version PR with the release app token so CI runs on it --- .github/workflows/publish.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1ae1560..9cdea29 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,7 +21,18 @@ jobs: pull-requests: write id-token: write # npm OIDC trusted publishing - no NPM_TOKEN secret needed steps: + - name: Mint release app token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.RELEASE_APP_ID }} + private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: ${{ github.event.repository.name }} + - uses: actions/checkout@v4 + with: + token: ${{ steps.app-token.outputs.token }} - uses: pnpm/action-setup@v4 with: @@ -49,5 +60,5 @@ jobs: commit: "chore: version packages" title: "chore: version packages" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} # app token, so the version PR's pushes start CI NPM_CONFIG_PROVENANCE: true From 21cf6ecf1ae54314a3ffd116f48848e018c99ce9 Mon Sep 17 00:00:00 2001 From: "Brett Adams (Firstmate)" Date: Fri, 6 Nov 2026 20:06:03 +1000 Subject: [PATCH 2/3] Keep the app token out of git config during install and build --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9cdea29..782b57f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v4 with: - token: ${{ steps.app-token.outputs.token }} + persist-credentials: false # changesets/action writes its own credential from the app token - uses: pnpm/action-setup@v4 with: From 7fda66dcb23885e1a3555e6d26b0aa4e02f49b85 Mon Sep 17 00:00:00 2001 From: "Brett Adams (Firstmate)" Date: Fri, 6 Nov 2026 20:09:50 +1000 Subject: [PATCH 3/3] Limit the release app token to contents and pull requests --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 782b57f..9338005 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,6 +29,8 @@ jobs: private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} owner: ${{ github.repository_owner }} repositories: ${{ github.event.repository.name }} + permission-contents: write + permission-pull-requests: write - uses: actions/checkout@v4 with: