Skip to content

Commit

Permalink
ci: let dependabot[bot] merge prs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrinds committed Mar 10, 2023
1 parent 919a505 commit 2f49b71
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ updates:
open-pull-requests-limit: 10
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
day: "tuesday"
commit-message:
prefix: "chore"

Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/auto-merge-dependabot-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://remarkablemark.org/blog/2022/11/18/dependabot-auto-merge-pull-request/
name: "Auto-merge dependabot"
on: pull_request_target
permissions:
contents: write
pull-requests: write

jobs:
auto-merge-dependabot-pr:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ github.token }}

steps:
- name: Approve Dependabot PR
run: gh pr review --approve $PR_URL

- name: Auto-merge Dependabot PR
if: contains(github.event.pull_request.title, 'chore')
run: gh pr merge --auto --merge $PR_URL

0 comments on commit 2f49b71

Please sign in to comment.