Skip to content

Merge updates

Merge updates #39

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,
})