-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.26 KB
/
dependabot.yml
File metadata and controls
45 lines (40 loc) · 1.26 KB
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
35
36
37
38
39
40
41
42
43
44
45
# Based on code from https://andre.arko.net/2022/05/15/automatic-dependabot-merges/
name: "Merge updates"
on:
workflow_run:
workflows:
- "Tests and Checks"
types:
- "completed"
branches:
- "dependabot/**"
permissions:
contents: write
pull-requests: write
jobs:
merge:
name: "Merge"
runs-on: "ubuntu-latest"
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' &&
github.actor == 'dependabot[bot]'
steps:
- name: "Approve pull request"
uses: "juliangruber/approve-pull-request-action@v2"
with:
github-token: "${{ secrets.IMPRESSBOT_TOKEN }}"
number: "${{ github.event.workflow_run.pull_requests[0].number }}"
- name: "Merge pull request"
uses: "actions/github-script@v8"
with:
github-token: "${{ secrets.IMPRESSBOT_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,
})