Skip to content

PR - Dependabot auto merge #2538

PR - Dependabot auto merge

PR - Dependabot auto merge #2538

name: PR - Dependabot auto merge
on:
workflow_run:
workflows: ["Build, test and package"]
types:
- completed
defaults:
run:
shell: pwsh
jobs:
auto-merge-pr:
name: Auto merge dependabot PR
if: github.actor == 'dependabot[bot]' && github.event.workflow_run.conclusion == 'success'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Dump github context for debug purposes
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: $env:GITHUB_CONTEXT
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Approve and merge dependabot PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$prNumber = "${{ github.event.workflow_run.pull_requests[0].number }}"
gh pr merge --auto --squash --delete-branch $prNumber