Skip to content

Commit eda5a81

Browse files
authored
feat: add auto-merge configuration for Dependabot PRs (#187)
1 parent 37cf75a commit eda5a81

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ workflows:
193193
matrix:
194194
parameters:
195195
exe: [ docker-amd64-image, docker-arm64-image ]
196-
python-image: [ << pipeline.parameters.default-python-image >>, "cimg/python:3.9", "cimg/python:3.10", "cimg/python:3.11", "cimg/python:3.12", cimg/python:3.13 ]
196+
python-image: [ << pipeline.parameters.default-python-image >>, "cimg/python:3.9", "cimg/python:3.10", "cimg/python:3.11", "cimg/python:3.12", "cimg/python:3.13" ]
197197
- tests-python:
198198
requires:
199199
- tests-python

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ updates:
55
schedule:
66
interval: "daily"
77
open-pull-requests-limit: 10
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
open-pull-requests-limit: 10
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Auto-merge Dependabot PRs
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, synchronize, ready_for_review, labeled]
6+
7+
jobs:
8+
automerge:
9+
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
checks: read
15+
steps:
16+
- name: Fetch Dependabot metadata
17+
id: metadata
18+
uses: dependabot/fetch-metadata@v2
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Approve PR
23+
env:
24+
PR_URL: ${{ github.event.pull_request.html_url }}
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: gh pr review --approve "$PR_URL"
27+
28+
- name: Enable auto-merge
29+
env:
30+
PR_URL: ${{ github.event.pull_request.html_url }}
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: gh pr merge --auto --squash "$PR_URL"

0 commit comments

Comments
 (0)