Skip to content

Commit 06ceaac

Browse files
authored
ci: publish releases using the @slackapi github app token (#2883)
1 parent 3af4cb8 commit 06ceaac

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,21 @@ jobs:
5151
contents: write
5252
id-token: write # OIDC: https://docs.npmjs.com/trusted-publishers
5353
steps:
54+
- name: Gather credentials
55+
id: credentials
56+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
57+
with:
58+
client-id: ${{ secrets.GH_APP_CLIENT_ID }}
59+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
60+
owner: ${{ github.repository_owner }}
61+
repositories: ${{ github.event.repository.name }}
62+
permission-contents: write
63+
5464
- name: Checkout repo
5565
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5666
with:
5767
persist-credentials: true
68+
token: ${{ steps.credentials.outputs.token }}
5869

5970
- name: Setup Node
6071
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
@@ -72,7 +83,7 @@ jobs:
7283
createGithubReleases: true
7384
publish: npm run changeset -- publish
7485
env:
75-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
GITHUB_TOKEN: ${{ steps.credentials.outputs.token }}
7687

7788
- name: Get publication details
7889
if: steps.changesets.outputs.published == 'true'
@@ -81,7 +92,7 @@ jobs:
8192
echo "url=$(gh release view --json url -q .url)" >> "$GITHUB_OUTPUT"
8293
echo "message=$(echo "$PUBLISHED_PACKAGES" | jq -r '.[] | "\(.name)@\(.version)"' | paste -sd ', ' -)" >> "$GITHUB_OUTPUT"
8394
env:
84-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
GH_TOKEN: ${{ steps.credentials.outputs.token }}
8596
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
8697

8798
- name: Notify Slack

0 commit comments

Comments
 (0)