diff --git a/.github/workflows/auto-approve-n-merge.yml b/.github/workflows/auto-approve-n-merge.yml new file mode 100644 index 0000000..0d5b9e8 --- /dev/null +++ b/.github/workflows/auto-approve-n-merge.yml @@ -0,0 +1,27 @@ +name: Auto approve and merge PRs by dependabot + +on: + pull_request + +jobs: + autoapprove: + name: Auto Approve a PR by dependabot + runs-on: ubuntu-latest + steps: + - name: Auto approve + uses: hmarr/auto-approve-action@v2.0.0 + if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + automerge: + name: Auto merge after successful checks + needs: autoapprove + runs-on: ubuntu-latest + steps: + - name: Auto merge + uses: pascalgn/automerge-action@135f0bdb927d9807b5446f7ca9ecc2c51de03c4a + if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MERGE_LABELS: dependencies + MERGE_METHOD: rebase