From a846f4675eb3c1642bfd4ffbabeb6f444f80be8e Mon Sep 17 00:00:00 2001 From: Brandon Arp Date: Fri, 30 Aug 2024 09:33:29 -0700 Subject: [PATCH] dependabot automation --- .github/workflows/dependabot_automation.yml | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/dependabot_automation.yml diff --git a/.github/workflows/dependabot_automation.yml b/.github/workflows/dependabot_automation.yml new file mode 100644 index 0000000..8c046cd --- /dev/null +++ b/.github/workflows/dependabot_automation.yml @@ -0,0 +1,28 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'ArpNetworking/metrics-client-java' + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Enable auto-approve for patch version update PRs + if: steps.metadata.outputs.update-type == 'version-update:semver-patch' + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}}