Skip to content

Commit 809621b

Browse files
4
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
1 parent ba9ec8c commit 809621b

2 files changed

Lines changed: 37 additions & 6 deletions

File tree

.github/workflows/autoMerge.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
ref: ${{ github.head_ref }}
2929
# Enable GitHub auto merge
30-
- name: Enable Pull Request Automerge
31-
run: gh pr merge --merge --auto
32-
env:
33-
GH_TOKEN: ${{ secrets.AUTOMERGE }}
30+
# - name: Enable Pull Request Automerge
31+
# run: gh pr merge --merge --auto
32+
# env:
33+
# GH_TOKEN: ${{ secrets.AUTOMERGE }}

.github/workflows/renovate-approve-merge.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name: Auto approve renovate PRs
1010

1111
on:
12-
pull_request: # zizmor: ignore[dangerous-triggers]
12+
pull_request_target: # zizmor: ignore[dangerous-triggers]
1313
branches:
1414
- main
1515
- master
@@ -18,13 +18,44 @@ on:
1818
permissions:
1919
contents: read
2020

21+
concurrency:
22+
group: renovate-approve-merge-${{ github.head_ref || github.run_id }}
23+
cancel-in-progress: true
24+
2125
jobs:
2226
auto-approve-merge:
27+
if: github.event.pull_request.user.login == 'renovate[bot]'
2328
runs-on: ubuntu-latest
29+
permissions:
30+
# for hmarr/auto-approve-action to approve PRs
31+
pull-requests: write
32+
# for alexwilson/enable-github-automerge-action to approve PRs
33+
contents: write
2434

2535
steps:
36+
- name: Disabled on forks
37+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
38+
run: |
39+
echo 'Can not approve PRs from forks'
40+
exit 1
41+
42+
- uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
43+
id: branchname
44+
with:
45+
repo-token: ${{ secrets.GITHUB_TOKEN }}
46+
47+
# GitHub actions bot approve
48+
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
49+
if: startsWith(steps.branchname.outputs.branch, 'renovate/')
50+
with:
51+
github-token: ${{ secrets.GITHUB_TOKEN }}
52+
53+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
54+
with:
55+
ref: ${{ github.head_ref }}
56+
2657
# Enable GitHub auto merge
2758
- name: Enable Pull Request Automerge
2859
run: gh pr merge --merge --auto
2960
env:
30-
GH_TOKEN: ${{ secrets.AUTOMERGE }}
61+
GH_TOKEN: ${{ secrets.AUTOMERGE }}

0 commit comments

Comments
 (0)