Skip to content

Commit 191c064

Browse files
authored
Merge pull request #726 from nextcloud/fix/auto-approve
fix: use one-line `gh` script instead of unmaintained action
2 parents 7bae095 + 4eac221 commit 191c064

3 files changed

Lines changed: 18 additions & 15 deletions

File tree

workflow-templates/dependabot-approve-merge.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
if: github.event.pull_request.user.login == 'dependabot[bot]'
2828
runs-on: ubuntu-latest-low
2929
permissions:
30-
# for hmarr/auto-approve-action to approve PRs
30+
# for auto-approve step to work
3131
pull-requests: write
3232
# for alexwilson/enable-github-automerge-action to approve PRs
3333
contents: write
@@ -50,11 +50,12 @@ jobs:
5050
with:
5151
github-token: ${{ secrets.GITHUB_TOKEN }}
5252

53-
# GitHub actions bot approve
54-
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
53+
- name: GitHub actions bot approve
5554
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
56-
with:
57-
github-token: ${{ secrets.GITHUB_TOKEN }}
55+
run: gh pr review --approve "$PR_URL"
56+
env:
57+
PR_URL: ${{ github.event.pull_request.html_url }}
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5859

5960
# Enable GitHub auto merge
6061
- name: Auto merge

workflow-templates/renovate-approve-merge.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
if: github.event.pull_request.user.login == 'renovate[bot]'
2828
runs-on: ubuntu-latest
2929
permissions:
30-
# for hmarr/auto-approve-action to approve PRs
30+
# for auto-approve step to work
3131
pull-requests: write
3232
# for alexwilson/enable-github-automerge-action to approve PRs
3333
contents: write
@@ -44,11 +44,12 @@ jobs:
4444
with:
4545
repo-token: ${{ secrets.GITHUB_TOKEN }}
4646

47-
# GitHub actions bot approve
48-
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
47+
- name: GitHub actions bot approve
4948
if: startsWith(steps.branchname.outputs.branch, 'renovate/')
50-
with:
51-
github-token: ${{ secrets.GITHUB_TOKEN }}
49+
run: gh pr review --approve "$PR_URL"
50+
env:
51+
PR_URL: ${{ github.event.pull_request.html_url }}
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5253

5354
# Enable GitHub auto merge
5455
- name: Auto merge

workflow-templates/update-nextcloud-ocp-approve-merge.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
if: github.actor == 'nextcloud-command'
2828
runs-on: ubuntu-latest-low
2929
permissions:
30-
# for hmarr/auto-approve-action to approve PRs
30+
# for auto-approve-action to approve PRs
3131
pull-requests: write
3232
# for alexwilson/enable-github-automerge-action to approve PRs
3333
contents: write
@@ -44,11 +44,12 @@ jobs:
4444
with:
4545
repo-token: ${{ secrets.GITHUB_TOKEN }}
4646

47-
# GitHub actions bot approve
48-
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
47+
- name: GitHub actions bot approve
4948
if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp')
50-
with:
51-
github-token: ${{ secrets.GITHUB_TOKEN }}
49+
run: gh pr review --approve "$PR_URL"
50+
env:
51+
PR_URL: ${{ github.event.pull_request.html_url }}
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5253

5354
# Enable GitHub auto merge
5455
- name: Auto merge

0 commit comments

Comments
 (0)