Skip to content

Commit 7fe8533

Browse files
committed
chore(deps): add auto-merge workflow for dependabot
1 parent 22b4975 commit 7fe8533

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/dependabot.yml

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

0 commit comments

Comments
 (0)