Skip to content

Commit

Permalink
ci(gh actions): added PR auto-merge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed Oct 24, 2023
1 parent 3ec96c5 commit 29ce4aa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/auto-merge-dependabot-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
tests:
uses: ./.github/workflows/test.yml
dependabot:
name: "Auto-merge Dependabot PR"
runs-on: ubuntu-latest
needs: tests
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
# (fixes, features but not major upgrades!)
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# separate job to set as required in branch protection,
# as the build names above change each time Node versions change
lint:
name: Linting
name: 🧪 Linting
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -41,7 +41,7 @@ jobs:
matrix:
java-version: ${{ fromJson(vars.RTLDEV_MW_CI_JAVA_MATRIX) }}

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

steps:
Expand Down

0 comments on commit 29ce4aa

Please sign in to comment.