From cecb27975c6a17360d9647c0cbc9c02ccc0d1ad2 Mon Sep 17 00:00:00 2001 From: Saman Ehsan Date: Mon, 4 Nov 2024 12:02:38 -0500 Subject: [PATCH] Allow single approval for dependabot PRs --- .../workflows/auto-approve-dependabot-prs.yml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/auto-approve-dependabot-prs.yml diff --git a/.github/workflows/auto-approve-dependabot-prs.yml b/.github/workflows/auto-approve-dependabot-prs.yml new file mode 100644 index 00000000..96048110 --- /dev/null +++ b/.github/workflows/auto-approve-dependabot-prs.yml @@ -0,0 +1,21 @@ +name: Dependabot auto-approve +on: pull_request + +permissions: + pull-requests: write + +jobs: + dependabot: + 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 + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file