summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorMartin Nordholts <enselic@gmail.com>2023-10-12 20:46:27 +0200
committerMartin Nordholts <enselic@gmail.com>2023-10-17 06:18:51 +0200
commitc42fc810eaa6e6800114f63b247360ea679d8fdb (patch)
treef3f064052ca31361abedbadf0934c4927d83b474 /.github
parent6baebd79fa9562bce3ff6549a4f3c9cc3c767cf1 (diff)
Setup auto-merge of dependabot PRs that pass CI
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/Auto-merge-dependabot-PRs.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/.github/workflows/Auto-merge-dependabot-PRs.yml b/.github/workflows/Auto-merge-dependabot-PRs.yml
new file mode 100644
index 00000000..0e346b03
--- /dev/null
+++ b/.github/workflows/Auto-merge-dependabot-PRs.yml
@@ -0,0 +1,23 @@
+# This workflow triggers auto-merge of any PR that dependabot creates so that
+# PRs will be merged automatically without maintainer intervention if CI passes
+name: Auto-merge dependabot PRs
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ auto-merge:
+ if: github.repository == 'sharkdp/bat' && startsWith(github.head_ref, 'dependabot/')
+ runs-on: ubuntu-latest
+ environment:
+ name: auto-merge
+ url: https://github.com/sharkdp/bat/blob/main/.github/workflows/Auto-merge-dependabot-PRs.yml
+ env:
+ GITHUB_TOKEN: ${{ secrets.AUTO_MERGE_GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v3
+ - run: |
+ gh pr review ${{ github.event.pull_request.number }} --comment --body "If CI passes, this dependabot PR will be [auto-merged](https://github.com/sharkdp/bat/blob/main/.github/workflows/Auto-merge-dependabot-PRs.yml) 🚀"
+ - run: |
+ gh pr merge --auto --squash ${{ github.event.pull_request.number }}