From 29ffb48387d29df6ff4ed46f0b3498425ffe2ad8 Mon Sep 17 00:00:00 2001 From: skye rogers Date: Fri, 28 Mar 2025 15:40:09 -0700 Subject: [PATCH] combine dependabotautomerge.yml with maven.yml for workflow completion check --- .github/workflows/DependabotAutoMerge.yml | 3 --- .github/workflows/maven.yml | 24 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/DependabotAutoMerge.yml b/.github/workflows/DependabotAutoMerge.yml index 6c3d7dfd..a8199b10 100644 --- a/.github/workflows/DependabotAutoMerge.yml +++ b/.github/workflows/DependabotAutoMerge.yml @@ -14,11 +14,8 @@ permissions: pull-requests: write jobs: - build_check: - uses: ./.github/workflows/maven.yml dependabot: runs-on: ubuntu-latest - needs: build_check if: github.event.pull_request.user.login == 'dependabot[bot]' steps: - name: Dependabot metadata diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 1a325e1b..d132e0f5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -14,6 +14,11 @@ on: pull_request: branches: - "master" + +permissions: + contents: write + pull-requests: write + jobs: build: runs-on: ubuntu-latest @@ -36,4 +41,21 @@ jobs: java-version: '8' distribution: 'corretto' - name: Check backwards compatibility of changes - run: .github/scripts/backwards_compatibility_check.sh \ No newline at end of file + run: .github/scripts/backwards_compatibility_check.sh + dependabot: + needs: [build] + runs-on: ubuntu-latest + if: github.event.pull_request.user.login == 'dependabot[bot]' + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + alert-lookup: true + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Enable auto-merge for Dependabot PRs + if: steps.metadata.outputs.update-type != 'version-update:semver-major' && steps.metadata.outputs.cvss > 0 + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file