aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/auto-merge.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/auto-merge.yml')
-rw-r--r--.github/workflows/auto-merge.yml29
1 files changed, 29 insertions, 0 deletions
diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml
new file mode 100644
index 0000000..3ea4f02
--- /dev/null
+++ b/.github/workflows/auto-merge.yml
@@ -0,0 +1,29 @@
+name: Dependabot auto-merge
+
+on:
+ pull_request:
+ branches:
+ - master
+
+permissions:
+ issues: write
+ pull-requests: write
+
+jobs:
+ auto-merge:
+ runs-on: ubuntu-latest
+ if: github.actor == 'dependabot[bot]'
+ steps:
+ - name: Dependabot metadata
+ id: dependabot-metadata
+ uses: dependabot/fetch-metadata@v1
+ with:
+ github-token: '${{ secrets.GITHUB_TOKEN }}'
+ - name: Enable auto-merge for Dependabot PRs
+ if: contains(fromJSON('["version-update:semver-patch", "version-update:semver-minor"]'), steps.dependabot-metadata.outputs.update-type)
+ run: |
+ gh pr review --approve "$PR_URL"
+ gh pr merge --auto --squash "$PR_URL"
+ env:
+ PR_URL: ${{github.event.pull_request.html_url}}
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}