From 4be394c01769bd5e9604e2c4590f2515d9a0117b Mon Sep 17 00:00:00 2001 From: Aaron Lippold Date: Wed, 22 May 2024 09:25:09 -0700 Subject: [PATCH] adding automerge Signed-off-by: Aaron Lippold --- .github/workflows/auto-approve-and-merge.yml | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/auto-approve-and-merge.yml diff --git a/.github/workflows/auto-approve-and-merge.yml b/.github/workflows/auto-approve-and-merge.yml new file mode 100644 index 0000000..ba44417 --- /dev/null +++ b/.github/workflows/auto-approve-and-merge.yml @@ -0,0 +1,22 @@ +name: Auto approve and Merge Dependabot PRs +on: + pull_request_target: + types: [labeled] +permissions: + pull-requests: write + contents: write + +jobs: + approve: + name: Auto-approve dependabot PRs + if: github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'dependencies') + runs-on: ubuntu-22.04 + steps: + - uses: hmarr/auto-approve-action@v3 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}