-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (60 loc) · 1.77 KB
/
automerge.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
---
name: Automerge
on:
pull_request:
branches:
- main
jobs:
changes:
name: Get changes
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.actor == 'dependabot[bot]'
permissions:
checks: read
outputs:
has_changes: ${{ steps.changed.outputs.any_changed == 'true' }}
is_generation_successful: ${{ steps.checks.outputs.conclusion == 'success' }}
steps:
- name: Wait for checks
uses: fountainhead/[email protected]
id: checks
with:
checkName: Generate code
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get changed generated files
id: changed
uses: tj-actions/changed-files@v44
with:
files: |
src/lib/seam/connect/routes/**
merge:
name: Merge
runs-on: ubuntu-latest
timeout-minutes: 30
needs: changes
if: needs.changes.outputs.has_changes == 'true'
steps:
- name: Approve pull request
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Merge pull request
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
close:
name: Close
runs-on: ubuntu-latest
timeout-minutes: 30
needs: changes
if: needs.changes.outputs.has_changes == 'false' && needs.changes.outputs.is_generation_successful == 'true'
steps:
- name: Close pull request
run: gh pr close "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}