Skip to content

Commit

Permalink
auto-merge green dependabots
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Nov 23, 2023
1 parent 8ed1060 commit 1ac9c7f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/merge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Merge updates"
on:
workflow_run:
workflows: ["CI"]
types: ["completed"]
branches: ["dependabot/**"]
jobs:
merge:
name: "Merge"
runs-on: "ubuntu-latest"
permissions:
contents: write
issues: write
pull-requests: write
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' &&
github.actor == 'dependabot[bot]'
steps:
- name: "Merge pull request"
uses: "actions/github-script@v7"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const pullRequest = context.payload.workflow_run.pull_requests[0]
const repository = context.repo
await github.rest.pulls.merge({
merge_method: "merge",
owner: repository.owner,
pull_number: pullRequest.number,
repo: repository.repo,
})

0 comments on commit 1ac9c7f

Please sign in to comment.