Skip to content

Commit

Permalink
CI: Add dependabot auto-merge
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Orsula <[email protected]>
  • Loading branch information
AndrejOrsula committed Feb 27, 2024
1 parent d4e1f4e commit 5234a7e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Dependabot auto-merge
on:
pull_request:

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Fetch metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: gh pr review --approve "$PR_URL"
- name: Enable auto-merge
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: gh pr merge --auto --merge "$PR_URL"

0 comments on commit 5234a7e

Please sign in to comment.