Skip to content

Commit

Permalink
feat: simplify auto merge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
thangbuiq committed Feb 9, 2024
1 parent 6293397 commit 89b420d
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/dependabot.auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,13 @@ on:
pull_request:

jobs:
worker:
dependabot:
name: 'Dependabot'
runs-on: ubuntu-latest

if: github.actor == 'dependabot[bot]'
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- name: automerge
uses: actions/github-script@0.2.0
with:
script: |
github.pullRequests.createReview({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
event: 'APPROVE'
})
github.pullRequests.merge({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number
})
github-token: ${{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}}
GITHUB_TOKEN: ${{secrets.TOKEN_GITHUB}}

0 comments on commit 89b420d

Please sign in to comment.