authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-17 14:55:27-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-17 14:55:27-07:00
log55560f5116c708ad5bbb466039ae4704448711bc
tree12433ed2aba0478569d0ff7255ac2197eea093c6
parent3710ddb6113f0ac6043e9c5880655fa45e92840b
signature Signed by PGP key B5690EEEBB952194

Use GitHub App token when checking out main in release workflow (#1175)


1 files changed, 22 insertions(+), 2 deletions(-)

.github/workflows/release.yml+22-2
...@@ -308,11 +308,31 @@ jobs:...@@ -308,11 +308,31 @@ jobs:
308 needs: [preflight, release]308 needs: [preflight, release]
309 runs-on: ubuntu-24.04309 runs-on: ubuntu-24.04
310 steps:310 steps:
311 - id: app_token
312 name: Mint release app token
313 uses: actions/create-github-app-token@v2
314 with:
315 app-id: ${{ vars.RELEASE_APP_ID }}
316 private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
317 owner: ${{ github.repository_owner }}
318
311 - name: Checkout319 - name: Checkout
312 uses: actions/checkout@v6320 uses: actions/checkout@v6
313 with:321 with:
314 ref: main322 ref: main
315 fetch-depth: 0323 fetch-depth: 0
324 token: ${{ steps.app_token.outputs.token }}
325 persist-credentials: true
326
327 - id: app_bot
328 name: Resolve GitHub App bot identity
329 env:
330 GH_TOKEN: ${{ steps.app_token.outputs.token }}
331 APP_SLUG: ${{ steps.app_token.outputs.app-slug }}
332 run: |
333 user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
334 echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT"
335 echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT"
316336
317 - name: Setup Bun337 - name: Setup Bun
318 uses: oven-sh/setup-bun@v2338 uses: oven-sh/setup-bun@v2
...@@ -349,8 +369,8 @@ jobs:...@@ -349,8 +369,8 @@ jobs:
349 exit 0369 exit 0
350 fi370 fi
351371
352 git config user.name "github-actions[bot]"372 git config user.name "${{ steps.app_bot.outputs.name }}"
353 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"373 git config user.email "${{ steps.app_bot.outputs.email }}"
354374
355 git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json bun.lock375 git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json bun.lock
356 git commit -m "chore(release): prepare $RELEASE_TAG"376 git commit -m "chore(release): prepare $RELEASE_TAG"