Skip to content

Commit ccccc7b

Browse files
authored
Enable Dependabot auto-merge on successful validation (#28)
* ci: auto-merge dependabot updates * ci: use official dependabot auto-merge workflow
1 parent 4f3b7ab commit ccccc7b

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Dependabot auto-merge
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
jobs:
10+
dependabot:
11+
if: github.actor == 'dependabot[bot]'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Fetch Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@v2
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
20+
- name: Enable auto-merge for Dependabot PRs
21+
if: ${{ steps.metadata.outputs.update-type == 'security-update' || contains(fromJson('["version-update:semver-minor","version-update:semver-patch"]'), steps.metadata.outputs.update-type) }}
22+
run: gh pr merge --auto --squash "$PR_URL"
23+
env:
24+
PR_URL: ${{ github.event.pull_request.html_url }}
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)