Skip to content

Commit 8fe24ce

Browse files
authored
ci: Add GH action that clicks "enable auto-merge" on dependabot PRs (prometheus#15967)
This will merge on green all non-conflicting dependabot PRs. Signed-off-by: bwplotka <bwplotka@gmail.com>
1 parent 00b69ef commit 8fe24ce

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Dependabot auto-merge
3+
on: pull_request
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
7+
cancel-in-progress: true
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
dependabot:
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
runs-on: ubuntu-latest
18+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.repository_owner == 'prometheus' }}
19+
steps:
20+
- name: Dependabot metadata
21+
id: metadata
22+
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0
23+
with:
24+
github-token: "${{ secrets.GITHUB_TOKEN }}"
25+
- name: Enable auto-merge for Dependabot PRs
26+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
27+
run: gh pr merge --auto --merge "$PR_URL"
28+
env:
29+
PR_URL: ${{github.event.pull_request.html_url}}
30+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)