diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..8098c92 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,28 @@ +name: Dependabot +on: + pull_request: + paths: + - package-lock.json + +permissions: + contents: write + pull-requests: write + +jobs: + auto-merge: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve a PR + if: contains(steps.dependabot-metadata.outputs.dependency-names, 'all-the-package-repos') + run: | + gh pr review --approve "$PR_URL" + gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"