-
Notifications
You must be signed in to change notification settings - Fork 278
248 lines (246 loc) · 10.7 KB
/
update_project_labels.yaml
File metadata and controls
248 lines (246 loc) · 10.7 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
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
name: Update Project Labels
on:
pull_request_target:
types:
- opened
- reopened
- labeled
- unlabeled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
baseline-labels:
name: Baseline labels
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Lack of baseline labels
if: |
!contains(github.event.pull_request.labels.*.name, 'No Baseline Change') &&
!contains(github.event.pull_request.labels.*.name, 'Baseline Updates') &&
!contains(github.event.pull_request.labels.*.name, 'New Baselines')
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: 'Baseline Changes'
field-value: 'Unknown'
- name: Contradictory labels
if: |
contains(github.event.pull_request.labels.*.name, 'No Baseline Change') &&
(contains(github.event.pull_request.labels.*.name, 'Baseline Updates') ||
contains(github.event.pull_request.labels.*.name, 'New Baselines'))
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: 'Baseline Changes'
field-value: 'Unknown'
- name: Baseline changes labels
if: |
!contains(github.event.pull_request.labels.*.name, 'No Baseline Change') &&
( contains(github.event.pull_request.labels.*.name, 'Baseline Updates') ||
contains(github.event.pull_request.labels.*.name, 'New Baselines') )
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: 'Baseline Changes'
field-value: 'Yes'
- name: No baseline changes label
if: |
contains(github.event.pull_request.labels.*.name, 'No Baseline Change') &&
!contains(github.event.pull_request.labels.*.name, 'Baseline Updates') &&
!contains(github.event.pull_request.labels.*.name, 'New Baselines')
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: 'Baseline Changes'
field-value: 'No'
data-labels:
name: Input data
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Additions to current input-data directory required
if: |
contains(github.event.pull_request.labels.*.name, 'Adds Input Data') &&
!contains(github.event.pull_request.labels.*.name, 'Changes Existing Input Data')
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: "Input Data Req'd"
field-value: 'Adds'
- name: New input-data directory required
if: |
contains(github.event.pull_request.labels.*.name, 'Changes Existing Input Data') &&
!contains(github.event.pull_request.labels.*.name, 'Adds Input Data')
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: "Input Data Req'd"
field-value: 'Create New'
- name: No input data changes
if: |
(!contains(github.event.pull_request.labels.*.name, 'Changes Existing Input Data')) &&
(!contains(github.event.pull_request.labels.*.name, 'Adds Input Data'))
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: "Input Data Req'd"
field-value: 'None'
- name: Contradictory labels
if: |
contains(github.event.pull_request.labels.*.name, 'Adds Input Data') &&
contains(github.event.pull_request.labels.*.name, 'Changes Existing Input Data')
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: "Input Data Req'd"
field-value: 'Unknown'
priority-labels:
name: Priority
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Read Priority field
uses: EndBug/project-fields@v2.1.0
id: priority_field
with:
operation: get
fields: Priority
github_token: ${{ secrets.PR_PROJECT_TOKEN }}
project_url: https://github.com/orgs/ufs-community/projects/70
resource_url: ${{ github.event.pull_request.html_url }}
- name: Assign value to Priority field
id: assign_priority
run: |
PRIORITY="${{ steps.priority_field.outputs.values }}"
echo "priority=$PRIORITY" >> $GITHUB_OUTPUT
- name: Normal Priority
if: |
!contains(github.event.pull_request.labels.*.name, 'Priority: Critical') &&
!contains(github.event.pull_request.labels.*.name, 'Priority: High') &&
steps.assign_priority.outputs.priority != 'Combine'
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: 'Priority'
field-value: 'Normal'
- name: Critical priority
if: |
contains(github.event.pull_request.labels.*.name, 'Priority: Critical') &&
steps.assign_priority.outputs.priority != 'Combine'
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: 'Priority'
field-value: 'Critical'
- name: High Priority
if: |
(contains(github.event.pull_request.labels.*.name, 'Priority: High')) &&
steps.assign_priority.outputs.priority != 'Combine'
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: 'Priority'
field-value: 'High'
- name: Unknown Priority
if: |
contains(github.event.pull_request.labels.*.name, 'Priority: Critical') &&
contains(github.event.pull_request.labels.*.name, 'Priority: High')
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: 'Priority'
field-value: 'Unknown'
subcomponent-labels:
name: Subcomponents involved
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
env:
SUBCOMPONENTS: ''
steps:
- name: UFSATM
if: contains(github.event.pull_request.labels.*.name, 'UFSATM')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} UFSATM" >> $GITHUB_ENV
- name: CCPP
if: contains(github.event.pull_request.labels.*.name, 'CCPP')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} CCPP" >> $GITHUB_ENV
- name: atmos_cubed_sphere
if: contains(github.event.pull_request.labels.*.name, 'A3S')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} A3S" >> $GITHUB_ENV
- name: UPP
if: contains(github.event.pull_request.labels.*.name, 'UPP')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} UPP" >> $GITHUB_ENV
- name: stochastic_physics
if: contains(github.event.pull_request.labels.*.name, 'SP')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} SP" >> $GITHUB_ENV
- name: AQM
if: contains(github.event.pull_request.labels.*.name, 'AQM')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} AQM" >> $GITHUB_ENV
- name: CMEPS
if: contains(github.event.pull_request.labels.*.name, 'CMEPS')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} CMEPS" >> $GITHUB_ENV
- name: CDEPS
if: contains(github.event.pull_request.labels.*.name, 'CDEPS')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} CDEPS" >> $GITHUB_ENV
- name: CICE
if: contains(github.event.pull_request.labels.*.name, 'CICE')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} CICE" >> $GITHUB_ENV
- name: GOCART
if: contains(github.event.pull_request.labels.*.name, 'GOC')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} GOC" >> $GITHUB_ENV
- name: MOM6
if: contains(github.event.pull_request.labels.*.name, 'MOM')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} MOM" >> $GITHUB_ENV
- name: NOAHMP
if: contains(github.event.pull_request.labels.*.name, 'NMP')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} NMP" >> $GITHUB_ENV
- name: WW3
if: contains(github.event.pull_request.labels.*.name, 'WW3')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} WW3" >> $GITHUB_ENV
- name: LM4
if: contains(github.event.pull_request.labels.*.name, 'LM4')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} LM4" >> $GITHUB_ENV
- name: FB
if: contains(github.event.pull_request.labels.*.name, 'FB')
run: echo "SUBCOMPONENTS=${SUBCOMPONENTS} FB" >> $GITHUB_ENV
- name: Update subcomponents text
if: ${{ env.SUBCOMPONENTS != '' }}
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: "Subcomponent PRs"
field-value: ${{ env.SUBCOMPONENTS }}
- name: WM only
if: ${{ env.SUBCOMPONENTS == '' }}
uses: nipe0324/update-project-v2-item-field@v2.0.2
with:
project-url: https://github.com/orgs/ufs-community/projects/70
github-token: ${{ secrets.PR_PROJECT_TOKEN }}
field-name: "Subcomponent PRs"
field-value: 'WM only'