Skip to content

Commit f0d2054

Browse files
janiszclaude
andauthored
chore(ci): auto-merge dependabot PRs (#86)
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 0c425b5 commit f0d2054

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

.github/dependabot.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
version: 2
22
updates:
3-
# Monitor root Go module
43
- package-ecosystem: "gomod"
54
directory: "/"
65
schedule:
@@ -9,8 +8,11 @@ updates:
98
prefix: "chore"
109
prefix-development: "chore"
1110
include: "scope"
11+
labels:
12+
- "dependencies"
13+
- "go"
14+
- "auto-merge"
1215

13-
# Monitor e2e-tests tools Go module
1416
- package-ecosystem: "gomod"
1517
directory: "/e2e-tests/tools"
1618
schedule:
@@ -19,3 +21,6 @@ updates:
1921
prefix: "chore"
2022
prefix-development: "chore"
2123
include: "scope"
24+
labels:
25+
- "dependencies"
26+
- "go"

.github/workflows/auto-merge.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Dependabot auto-merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: |
12+
github.event.pull_request.user.login == 'dependabot[bot]' &&
13+
contains(github.event.pull_request.labels.*.name, 'auto-merge')
14+
steps:
15+
- name: Enable auto-merge for Dependabot PRs
16+
run: gh pr merge --auto --squash "$PR_URL" && gh pr review --approve "$PR_URL"
17+
env:
18+
PR_URL: ${{github.event.pull_request.html_url}}
19+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)