Skip to content

Commit bf0a2c2

Browse files
committed
Use dependabot for dependency upgrades
Issue gh-11
1 parent f2228a2 commit bf0a2c2

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: github-actions
5+
target-branch: main
6+
directory: /
7+
schedule:
8+
interval: weekly
9+
labels:
10+
- 'type: dependency-upgrade'
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Auto-Merge Dependabot PR
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
jobs:
10+
auto-merge:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'spring-io/spring-gradle-build-action' }}
13+
steps:
14+
- id: dependabot-metadata
15+
name: Dependabot Metadata
16+
uses: dependabot/[email protected]
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Enable auto-merge for Dependabot PRs
20+
if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' }}
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: gh pr merge --auto --rebase "$PR_URL"
25+
- uses: actions/checkout@v4
26+
- name: Update v2 branch
27+
run: git checkout v2 && git merge main && git push

0 commit comments

Comments
 (0)