Skip to content

Auto-merge Dependabot PRs #30

Auto-merge Dependabot PRs

Auto-merge Dependabot PRs #30

name: Auto-merge Dependabot PRs
on:
workflow_run:
workflows: [Build and Push Docker Image]
types: [completed]
permissions:
actions: write
contents: write
pull-requests: write
jobs:
merge:
if: >-
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.actor.login == 'dependabot[bot]'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Merge the validated update and publish master
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
run: |
set -euo pipefail
test -n "$PR_NUMBER"
gh pr checks "$PR_NUMBER" --watch --fail-fast --repo "$GH_REPO"
gh pr merge "$PR_NUMBER" --squash --delete-branch --repo "$GH_REPO"
gh workflow run docker-build.yml --ref master --repo "$GH_REPO"