From 3824f0f8212d643fe433226983bcb3a60fe1de18 Mon Sep 17 00:00:00 2001 From: Opeyemi Date: Mon, 16 Sep 2024 16:26:15 +0100 Subject: [PATCH] [BRE-246] - Use GH App for Auto PR (#4762) * Use GH-App for rc-cut workflow * Test * update version --- .github/workflows/version-bump.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 6d6b01b20338..421fca0b6841 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -62,8 +62,7 @@ jobs: with: keyvault: "bitwarden-ci" secrets: "github-gpg-private-key, - github-gpg-private-key-passphrase, - github-pat-bitwarden-devops-bot-repo-scope" + github-gpg-private-key-passphrase" - name: Import GPG key uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0 @@ -169,11 +168,19 @@ jobs: PR_BRANCH: ${{ steps.create-branch.outputs.name }} run: git push -u origin $PR_BRANCH + - name: Generate GH App token + uses: actions/create-github-app-token@3378cda945da322a8db4b193e19d46352ebe2de5 # v1.10.4 + id: app-token + with: + app-id: ${{ secrets.BW_GHAPP_ID }} + private-key: ${{ secrets.BW_GHAPP_KEY }} + owner: ${{ github.repository_owner }} + - name: Create version PR if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} id: create-pr env: - GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} PR_BRANCH: ${{ steps.create-branch.outputs.name }} TITLE: "Bump version to ${{ steps.set-final-version-output.outputs.version }}" run: | @@ -204,7 +211,7 @@ jobs: - name: Merge PR if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} env: - GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }} run: gh pr merge $PR_NUMBER --squash --auto --delete-branch