Skip to content

Commit

Permalink
Updated dependabot auto-merge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gdevxy committed Dec 22, 2024
1 parent 9f34674 commit 4ab57c0
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/dependabotautomerge.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
name: "Dependabot Automerge - Action"
name: Dependabot auto-merge
on: pull_request

on:
pull_request:
permissions:
contents: write
pull-requests: write

jobs:
worker:
dependabot:
runs-on: ubuntu-latest

if: github.actor == 'dependabot[bot]'
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'gdevxy/blog'
steps:
- name: automerge
uses: actions/[email protected]
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
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}}
github-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 4ab57c0

Please sign in to comment.