From 2fc4a0a97481299bf435c77cddb6ad90f11bba6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E7=8C=AB?= Date: Sat, 17 Dec 2022 08:35:04 +0900 Subject: [PATCH] Use app token to trigger next workflow --- .github/workflows/release.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eca9e24..9c5502d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,14 +16,19 @@ jobs: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') runs-on: ubuntu-latest timeout-minutes: 5 - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - RELEASE_BRANCH: ${{ github.event.pull_request.head.ref || github.event.inputs.version }} steps: + - id: generate-token + uses: tibdex/github-app-token@v1.7.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} - name: Create release draft id: release run: | version=${RELEASE_BRANCH#release/} gh release create ${version} --title ${version} --generate-notes + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} + GH_REPO: ${{ github.repository }} + RELEASE_BRANCH: ${{ github.event.pull_request.head.ref || github.event.inputs.version }}