diff --git a/.github/workflows/dependabot-auto-approve-always.yml b/.github/workflows/dependabot-auto-approve-always.yml new file mode 100644 index 00000000..e1eafcb1 --- /dev/null +++ b/.github/workflows/dependabot-auto-approve-always.yml @@ -0,0 +1,26 @@ +name: Dependabot auto-approve updates +on: pull_request + +permissions: + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + strategy: + matrix: + dependencyStartsWith: + - '@checkernetwork/prettier-config' + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: '${{ secrets.GITHUB_TOKEN }}' + - name: Approve a PR + if: ${{startsWith(steps.metadata.outputs.dependency-names, matrix.dependencyStartsWith)}} + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}