11# This workflow is provided via the organization template repository
22#
3- # https://github.com/nextcloud/.github
3+ # https://github.com/nextcloud-libraries /.github
44# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55#
6- # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
6+ # SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
77# SPDX-License-Identifier: MIT
88
9- name : Dependabot
9+ name : Auto approve Dependabot PRs
1010
1111on :
12- pull_request_target :
12+ pull_request_target : # zizmor: ignore[dangerous-triggers]
1313 branches :
1414 - main
1515 - master
@@ -24,11 +24,13 @@ concurrency:
2424
2525jobs :
2626 auto-approve-merge :
27- if : github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
27+ if : github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'
2828 runs-on : ubuntu-latest
2929 permissions :
3030 # for hmarr/auto-approve-action to approve PRs
3131 pull-requests : write
32+ # for alexwilson/enable-github-automerge-action to approve PRs
33+ contents : write
3234
3335 steps :
3436 - name : Disabled on forks
@@ -37,13 +39,20 @@ jobs:
3739 echo 'Can not approve PRs from forks'
3840 exit 1
3941
42+ - uses : mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
43+ id : branchname
44+ with :
45+ repo-token : ${{ secrets.GITHUB_TOKEN }}
46+
4047 # GitHub actions bot approve
41- - uses : hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
48+ - uses : hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
49+ if : startsWith(steps.branchname.outputs.branch, 'dependabot/')
4250 with :
4351 github-token : ${{ secrets.GITHUB_TOKEN }}
4452
45- # Nextcloud bot approve and merge request
46- - uses : ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
53+ # Enable GitHub auto merge
54+ - name : Auto merge
55+ uses : alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0
56+ if : startsWith(steps.branchname.outputs.branch, 'dependabot/')
4757 with :
48- target : minor
49- github-token : ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
58+ github-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments