Skip to content

Commit 53276f7

Browse files
authored
chore(ci): replace PAT with GitHub App (#370)
1 parent df84b6a commit 53276f7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424
publish:
2525
runs-on: macos-latest
2626
env:
27-
GH_TOKEN: ${{ secrets.POSTHOG_BOT_PAT }}
28-
GITHUB_TOKEN: ${{ secrets.POSTHOG_BOT_PAT }}
2927
NODE_ENV: production
3028
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
3129
APPLE_ID: ${{ secrets.APPLE_ID }}
@@ -35,11 +33,18 @@ jobs:
3533
APPLE_CODESIGN_CERT_PASSWORD: ${{ secrets.APPLE_CODESIGN_CERT_PASSWORD }}
3634
APPLE_CODESIGN_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_CODESIGN_KEYCHAIN_PASSWORD }}
3735
steps:
36+
- name: Get app token
37+
id: app-token
38+
uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc # v3
39+
with:
40+
app_id: ${{ secrets.GH_APP_ARRAY_RELEASER_APP_ID }}
41+
private_key: ${{ secrets.GH_APP_ARRAY_RELEASER_PRIVATE_KEY }}
42+
3843
- name: Checkout
39-
uses: actions/checkout@v5
44+
uses: actions/checkout@v6
4045
with:
4146
fetch-depth: 0
42-
token: ${{ secrets.POSTHOG_BOT_PAT }}
47+
token: ${{ steps.app-token.outputs.token }}
4348

4449
- name: Setup pnpm
4550
uses: pnpm/action-setup@v4
@@ -102,10 +107,12 @@ jobs:
102107
- name: Create tag
103108
env:
104109
APP_VERSION: ${{ steps.version.outputs.version }}
110+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
111+
REPOSITORY: ${{ github.repository }}
105112
run: |
106113
TAG="v$APP_VERSION"
107114
git tag -a "$TAG" -m "Release $TAG"
108-
git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }} "$TAG"
115+
git push "https://x-access-token:${GH_TOKEN}@github.com/$REPOSITORY" "$TAG"
109116
110117
- name: Build native modules
111118
run: pnpm --filter array run build-native

0 commit comments

Comments
 (0)