Skip to content

Commit 5d78722

Browse files
Dependabot + auto merge PRs
1 parent 4d7bf0c commit 5d78722

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ updates:
1010
- package-ecosystem: "pip" # package manager
1111
directory: "/" # Files stored in repository root
1212
schedule:
13-
interval: "monthly"
13+
interval: "weekly"
14+
day: "saturday"
15+
time: "10:00"
16+
timezone: "America/Chicago"
17+
open-pull-requests-limit: 5

.github/workflows/auto_approve.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request
2+
3+
name: auto_merge
4+
on: [pull_request, workflow_dispatch] # pull_request, push, workflow_dispatch
5+
6+
permissions:
7+
pull-requests: write
8+
9+
jobs:
10+
dependabot:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
14+
- name: Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@v1.1.1
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
- name: Approve a PR
20+
run: gh pr review --approve "$PR_URL"
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
24+
- name: Merge a PR
25+
run: gh pr merge "$PR_URL" --auto --squash
26+
env:
27+
PR_URL: ${{github.event.pull_request.html_url}}
28+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)