From 040d52dc4b10ab79b6e5a3fc3ffe3287a01e5c2d Mon Sep 17 00:00:00 2001 From: Gregor MacLennan Date: Mon, 9 Sep 2024 17:30:51 +0100 Subject: [PATCH] chore: use GitHub App token to create PR in workflow Fixes #662 This switches the github token used to create a pull request for a release candidate to use a token from a GitHub App that I have created for Awana Digital called "Awana PR Bot". The reason for this change is so that PR checks run when the PR is opened by the [`create-release-candidate.yml`](.github/workflows/create-release-candidate.yml) workflow. Without this change, workflows are not triggered by the PR being opened. --- .github/workflows/create-release-candidate.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-release-candidate.yml b/.github/workflows/create-release-candidate.yml index b0aa29371..7857838af 100644 --- a/.github/workflows/create-release-candidate.yml +++ b/.github/workflows/create-release-candidate.yml @@ -68,10 +68,16 @@ jobs: echo "DEPLOY_BRANCH_EXISTS=false" >> $GITHUB_ENV fi + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.PR_BOT_APP_ID }} + private-key: ${{ secrets.PR_BOT_PRIVATE_KEY }} + - name: Create Pull Request to deploy if: env.DEPLOY_BRANCH_EXISTS == 'true' env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} run: | new_version=${{ env.VERSION }} branch_name=${{ env.BRANCH_NAME }}