-
-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (31 loc) · 909 Bytes
/
Copy pathpr-dependabot-auto-merge.yml
File metadata and controls
34 lines (31 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: PR - Dependabot auto merge
on:
workflow_run:
workflows: ["Build and test"]
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@v6
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