Skip to content

Dependabot Auto-Merge #106

Dependabot Auto-Merge

Dependabot Auto-Merge #106

name: Dependabot Auto-Merge
on:
pull_request_target:
types: [assigned, opened, synchronize, reopened, ready_for_review]
check_suite:
types: [completed]
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-24.04
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Get PR URL
if: ${{ github.event_name == 'pull_request_target' }}
run: echo "PR_URL=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV
- name: Check CodeQL status
if: ${{ github.event_name == 'check_suite' && github.event.check_suite.conclusion == 'success' && github.event.check_suite.app.name == 'CodeQL' }}
run: echo "CodeQL check succeeded"
- name: Enable auto-merge for Dependabot PRs
if: ${{ github.event_name == 'check_suite' && github.event.check_suite.conclusion == 'success' && github.event.check_suite.app.name == 'CodeQL' }}
run: gh pr merge --auto -s "$PR_URL" --admin -d
env:
PR_URL: ${{ env.PR_URL }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}