-
Notifications
You must be signed in to change notification settings - Fork 2
149 lines (144 loc) · 4.8 KB
/
pull.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Pull Request Management
on:
pull_request:
types:
- opened
- edited
- synchronize
jobs:
# Automatically blocks WIP pull request based on the title
wip:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Get Configurations
uses: ./variable-mastermind/
with:
settings: ${{ secrets.SETTINGS }}
mode: 'environment'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Work in progress status
uses: wip/[email protected]
if: ${{env.wip_enabled}} == true
# Ensures semantic titles to ensure semantic is achieved when merge is squashed
conventional:
name: Conventional PR Title
runs-on: ubuntu-latest
needs: wip
steps:
- name: Get Configurations
uses: ./variable-mastermind/
with:
settings: ${{ secrets.SETTINGS }}
mode: 'environment'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check title
if: ${{env.semantic_enabled}} == true
uses: aslafy-z/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Setup labels
labeler:
name: Pull Labeler
needs: conventional
runs-on: ubuntu-latest
steps:
- name: Get Configurations
uses: ./variable-mastermind/
with:
settings: ${{ secrets.SETTINGS }}
mode: 'environment'
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
# super Labeler
- name: Super Labeller
uses: Videndum/[email protected]
with:
GITHUB_TOKEN: '${{ secrets.BOT_TOKEN }}'
# Label size based (soon to be merged with super labeler)
- uses: actions-ecosystem/action-size@v2
if: ${{env.size_enabled}} == true
id: size
with:
size_xs_label: ${{env.size_xs_label}}
size_s_label: ${{env.size_s_label}}
size_m_label: ${{env.size_m_label}}
size_l_label: ${{env.size_l_label}}
size_xl_label: ${{env.size_xl_label}}
size_xxl_label: ${{env.size_xxl_label}}
continue-on-error: true
- uses: actions-ecosystem/action-remove-labels@v1
if: ${{env.size_enabled}} == true
with:
github_token: ${{ secrets.BOT_TOKEN }}
labels: ${{ steps.size.outputs.stale_labels }}
continue-on-error: true
- uses: actions-ecosystem/action-add-labels@v1
if: ${{env.size_enabled}} == true
with:
github_token: ${{ secrets.BOT_TOKEN }}
labels: ${{ steps.size.outputs.new_label }}
continue-on-error: true
# Automatically approves
conflictCheck:
name: Pull Request Conflict Check
needs: labeler
runs-on: ubuntu-latest
steps:
- name: Get Configurations
uses: ./variable-mastermind/
with:
settings: ${{ secrets.SETTINGS }}
mode: 'environment'
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
- name: Warn potential conflicts
uses: wktk/conflibot@v1
if: ${{env.conflict_pull}} == true
with:
github-token: ${{ secrets.BOT_TOKEN }}
- name: check if prs are dirty
if: ${{env.conflict_master}} == true
uses: eps1lon/actions-label-merge-conflict@releases/1.x
with:
dirtyLabel: ${{env.conflict_dirty}}
repoToken: ${{ secrets.BOT_TOKEN }}
approval:
needs:
- conflictCheck
runs-on: ubuntu-latest
steps:
- name: Get Configurations
uses: ./variable-mastermind/
with:
settings: ${{ secrets.SETTINGS }}
mode: 'environment'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Automatically approve
uses: hmarr/[email protected]
if: (${{env.approve_enabled}} == true && contains(${{env.auto_whitelist}}, github.actor) || ${{env.approve_enabled}} == true && github.actor == github.repository_owner )
with:
github-token: ${{ secrets.BOT_TOKEN }}
automerge:
needs: approval
runs-on: ubuntu-latest
steps:
- name: Get Configurations
uses: ./variable-mastermind/
with:
settings: ${{ secrets.SETTINGS }}
mode: 'environment'
token: ${{ secrets.GITHUB_TOKEN }}
- name: automerge
if: ${{env.merge_enabled}} == true
uses: 'pascalgn/[email protected]'
env:
GITHUB_TOKEN: '${{ secrets.BOT_TOKEN }}'
MERGE_LABELS: ${{env.merge_labels}}
MERGE_REMOVE_LABELS: ${{env.merge_deleteLabels}}
MERGE_METHOD: ${{env.merge_method}}
MERGE_FORKS: ${{env.merge_forks}}
MERGE_RETRIES: ${{env.merge_retries}}
MERGE_RETRY_SLEEP: ${{env.merge_sleep}}
MERGE_DELETE_BRANCH: ${{env.merge_delete}}