-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (69 loc) · 2.08 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
63
64
65
66
67
68
69
70
71
---
name: Automerge
on:
pull_request:
branches:
- main
jobs:
changes:
name: Get changes for #${{ github.event.number }}
runs-on: ubuntu-latest
timeout-minutes: 30
# if: github.actor == 'dependabot[bot]'
permissions:
checks: read
outputs:
has_changes: ${{ steps.changed.outputs.any_changed == 'true' && steps.checks.outputs.conclusion == 'success'}}
steps:
- name: Wait for checks
uses: fountainhead/action-wait-for-check@v1.2.0
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:
dir_names: true
dir_names_include_files: |
src/lib/seam/connect/routes/**
merge:
name: Merge #${{ github.event.number }}
runs-on: ubuntu-latest
timeout-minutes: 30
needs: changes
if: needs.changes.outputs.has_changes == 'true'
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files_separator: ' '
dir_names: true
dir_names_include_files: |
src/lib/seam/connect/routes/**
- 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 --merge "$PR_URL"
# env:
# PR_URL: ${{ github.event.pull_request.html_url }}
# GH_TOKEN: ${{ secrets.GH_TOKEN }}
close:
name: Close #${{ github.event.number }}
runs-on: ubuntu-latest
timeout-minutes: 30
needs: changes
if: needs.changes.outputs.has_changes == 'false'
steps:
- name: Close pull request
# run: gh pr close "$PR_URL"
run: true
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}