Skip to content

Commit

Permalink
Update dependabot-auto-approve.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikfroehling authored Mar 8, 2024
1 parent 8b4dd6c commit 34a9ea2
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/dependabot-auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,13 @@ name: Dependabot auto-approve

on: pull_request

permissions:
pull-requests: write

jobs:
dependabot:
auto-approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
- uses: hmarr/auto-approve-action@v4
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Approve a PR
run: |
gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status`
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ];
then gh pr review --approve "$PR_URL"
else echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
fi
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
github-token: ${{ secrets.PR_APPROVAL }}

0 comments on commit 34a9ea2

Please sign in to comment.