Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

use gh cli to approve/automerge instead of 3rd party action (#81599)

Chris Vandoodewaardcb5e5847c49c
diff --git a/.github/actions/create-backport/action.yml b/.github/actions/create-backport/action.yml
index eeb83f3386b..295c7897af0 100644
--- a/.github/actions/create-backport/action.yml
+++ b/.github/actions/create-backport/action.yml
@@ -85,19 +85,15 @@ runs:
git checkout ${{ github.sha }}
- - name: Auto approve backport PR
+ - name: Approve and Merge the PR
if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'false' }}
- uses: juliangruber/approve-pull-request-action@68fcc9a5a73b5641cadf757cf99d73720dcb05d0 # v2.1.0
- with:
- github-token: ${{ inputs.github-token-2 }}
- number: ${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
-
- - name: Enable Pull Request Automerge
- if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'false' }}
- run: gh pr merge --squash --auto "$PR_NUMBER"
+ run: |
+ gh pr review --approve "$PR_NUMBER"
+ gh pr merge --squash --auto "$PR_NUMBER"
shell: bash
env:
- GH_TOKEN: ${{ inputs.github-token }}
+ # uses a different token than the token that created the PR so we can approve and merge it
+ GH_TOKEN: ${{ inputs.github-token-2 }}
PR_NUMBER: ${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
- uses: ./.github/actions/notify-pull-request
diff --git a/.github/workflows/translation-update.yml b/.github/workflows/translation-update.yml
index 9228832e390..147c2011006 100644
--- a/.github/workflows/translation-update.yml
+++ b/.github/workflows/translation-update.yml
@@ -144,14 +144,12 @@ jobs:
EOF
)"
- - name: Auto approve PR
- uses: juliangruber/approve-pull-request-action@68fcc9a5a73b5641cadf757cf99d73720dcb05d0 # v2.1.0
- with:
- github-token: ${{ github.token }}
- number: ${{ steps.create_pr.outputs.pr_number }}
-
- - name: Enable Pull Request Automerge
- run: gh pr merge --squash --auto "$PR_NUMBER"
+ - name: Approve and Merge the PR
+ run: |
+ gh pr review --approve "$PR_NUMBER"
+ gh pr merge --squash --auto "$PR_NUMBER"
+ shell: bash
env:
- GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
+ # uses a different token than the token that created the PR so we can approve and merge it
+ GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ steps.create_pr.outputs.pr_number }}