Skip to content

Commit 29ce4aa

Browse files
ci(gh actions): added PR auto-merge workflow
1 parent 3ec96c5 commit 29ce4aa

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Dependabot auto-merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
tests:
10+
uses: ./.github/workflows/test.yml
11+
dependabot:
12+
name: "Auto-merge Dependabot PR"
13+
runs-on: ubuntu-latest
14+
needs: tests
15+
if: ${{ github.actor == 'dependabot[bot]' }}
16+
steps:
17+
- name: Dependabot metadata
18+
id: metadata
19+
uses: dependabot/fetch-metadata@v1
20+
with:
21+
github-token: "${{ secrets.GITHUB_TOKEN }}"
22+
- name: Enable auto-merge for Dependabot PRs
23+
# (fixes, features but not major upgrades!)
24+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
25+
run: gh pr merge --auto --merge "$PR_URL"
26+
env:
27+
PR_URL: ${{github.event.pull_request.html_url}}
28+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# separate job to set as required in branch protection,
1717
# as the build names above change each time Node versions change
1818
lint:
19-
name: Linting
19+
name: 🧪 Linting
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout
@@ -41,7 +41,7 @@ jobs:
4141
matrix:
4242
java-version: ${{ fromJson(vars.RTLDEV_MW_CI_JAVA_MATRIX) }}
4343

44-
name: Test @ Java JDK ${{ matrix.java-version }}
44+
name: 🧪 Testing
4545
needs: lint
4646

4747
steps:

0 commit comments

Comments
 (0)