Skip to content

Commit

Permalink
auto-merge PR instead of commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
akash1810 committed Mar 2, 2024
1 parent 6529497 commit 5a3faf6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/dependabot-auto-approve.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# In this project, CI passing is a strong enough signal that the PR is safe to merge
# In this project, CI passing is a strong enough signal that the PR is safe to merge.

name: Dependabot auto-approve
on: pull_request

permissions:
# Dependabot requires those who comment "@dependabot merge" have push access to the repository:
# > Sorry, only users with push access can use that command.
contents: write

# Allow commenting on PRs
pull-requests: write

jobs:
Expand All @@ -23,7 +19,13 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Approve a PR
run: gh pr review --approve --body "@dependabot merge" "$PR_URL"
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 5a3faf6

Please sign in to comment.