Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Dependabot auto-approve / -merge
on: pull_request

jobs:
dependabot:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,12 @@ It just requires some manual adjustments/settings depending on your project:
## Contribute

You are very welcome to contribute to this template repository by opening a pull request against the main branch.

### GitHub Actions

- Dependabot auto-approve / -merge:
- If the actor is the Dependabot bot (i.e. on every commit by Dependabot)
the pull request is automatically approved and auto merge gets activated
(using squash merge).
Note that if you haven't enabled "auto merge" for your repository, the auto merge activation will fail.
If you want to use a merge type other than "squash merge" you have to edit the workflow.