diff --git a/.github/workflows/auto-merge-dependabot-pr.yml b/.github/workflows/auto-merge-dependabot-pr.yml new file mode 100644 index 00000000..5951a62c --- /dev/null +++ b/.github/workflows/auto-merge-dependabot-pr.yml @@ -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}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03a0babb..9d2770af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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: