-
-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (57 loc) · 2.04 KB
/
automerge-dependabot.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
#######################################
#######################################
## Dependabot automerge dependencies ##
#######################################
#######################################
#
# Documentation:
# https://medium.com/@toufik.airane/automerge-github-dependabot-alerts-with-github-actions-7cd6f5763750
#
######################
# name of the action #
######################
name: automerge on pull request
###############
# When to run #
###############
on: [ pull_request ]
#################
# Start the job #
#################
jobs:
automerge:
name: automerge dependabot
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' && github.repository == 'megalinter/megalinter'
steps:
- name: Wait for CI/CT/CD to succeed
uses: fountainhead/[email protected]
id: wait-for-build
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: Tests + Deploy Docker Image - DEV
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Wait for CI/CT/CD to succeed pt2
uses: fountainhead/[email protected]
id: wait-for-ci
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: MegaLinter
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: merge
if: steps.wait-for-build.outputs.conclusion == 'success' || steps.wait-for-build.outputs.conclusion == 'skipped' && steps.wait-for-ci.outputs.conclusion == 'success'
uses: actions/github-script@v6
with:
script: |
github.pulls.createReview({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
event: 'APPROVE'
})
github.pulls.merge({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number
})