Skip to content

Commit

Permalink
Feat: update the automerge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Dec 5, 2023
1 parent 2669a38 commit ddcf5e6
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Auto approve and merge PRs by dependabot
on:
pull_request:
types:
- synchronize
- opened
- reopened

permissions:
contents: write
pull-requests: write

jobs:
autoapprove:
name: Auto Approve a PR by dependabot
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' && success() && github.event_name == 'pull_request'
steps:
- name: Approve a PR for Github Bot
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Approve a PR for Anmol nagpal
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB}}

automerge:
runs-on: ubuntu-latest
steps:
- id: automerge
name: automerge
uses: pascalgn/[email protected]
if: github.event_name == 'pull_request' && github.event.action == 'synchronize' && github.event.pull_request.draft == false && success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB }}
MERGE_FILTER_AUTHOR: 'dependabot[bot]'
MERGE_METHOD: "merge"
MERGE_DELETE_BRANCH: "true"
MERGE_LABELS: "dependencies"
MERGE_REQUIRED_APPROVALS: ""

0 comments on commit ddcf5e6

Please sign in to comment.