-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (65 loc) · 2.59 KB
/
dependabot-automerge.yml
File metadata and controls
74 lines (65 loc) · 2.59 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Dependabot auto-merge
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Wait for tests to pass
uses: fountainhead/action-wait-for-check@v1.2.0
id: wait-for-tests
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: unit-test
ref: ${{ github.event.pull_request.head.sha }}
timeoutSeconds: 600
intervalSeconds: 30
- name: Wait for integration tests to pass
uses: fountainhead/action-wait-for-check@v1.2.0
id: wait-for-integration
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: integration-test
ref: ${{ github.event.pull_request.head.sha }}
timeoutSeconds: 600
intervalSeconds: 30
- name: Wait for LocalStack tests to pass
uses: fountainhead/action-wait-for-check@v1.2.0
id: wait-for-localstack
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: localstack-test
ref: ${{ github.event.pull_request.head.sha }}
timeoutSeconds: 600
intervalSeconds: 30
- name: Enable auto-merge for Dependabot PRs
if: |
steps.wait-for-tests.outputs.conclusion == 'success' &&
steps.wait-for-integration.outputs.conclusion == 'success' &&
steps.wait-for-localstack.outputs.conclusion == 'success'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on PR if tests failed
if: |
steps.wait-for-tests.outputs.conclusion != 'success' ||
steps.wait-for-integration.outputs.conclusion != 'success' ||
steps.wait-for-localstack.outputs.conclusion != 'success'
run: |
gh pr comment "$PR_URL" --body "🚫 Auto-merge skipped: one or more test jobs failed or timed out.
- unit-test: ${{ steps.wait-for-tests.outputs.conclusion }}
- integration-test: ${{ steps.wait-for-integration.outputs.conclusion }}
- localstack-test: ${{ steps.wait-for-localstack.outputs.conclusion }}
Please review the failing checks and resolve any issues."
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}