10
10
required : true
11
11
description : What project to triage issues/pr for
12
12
type : string
13
+ TRIAGE_EVENT_ACTION :
14
+ required : false
15
+ default : " ${{ github.event.action }}"
16
+ description : Event action that triggered to workflow
17
+ type : string
18
+ TRIAGE_EVENT_NAME :
19
+ required : false
20
+ default : " ${{ github.event_name }}"
21
+ description : Name of event that triggered to workflow
22
+ type : string
13
23
secrets :
14
24
WORKFLOW_TOKEN :
15
25
description : Token used to with permission to the project
@@ -32,43 +42,46 @@ jobs:
32
42
echo "[Debug] github.event.pull_request.author_association=${{ github.event.pull_request.author_association }}";
33
43
echo "[Debug] github.triggering_actor=${{ github.triggering_actor }}";
34
44
45
+ echo "[Debug] inputs.TRIAGE_EVENT_ACTION=${{ inputs.TRIAGE_EVENT_ACTION }}";
46
+ echo "[Debug] inputs.TRIAGE_EVENT_NAME=${{ inputs.TRIAGE_EVENT_NAME }}";
47
+
35
48
36
49
project-add :
37
50
name : Add
38
51
if : ${{(
39
52
(
40
- github.event_name == 'issues'
53
+ inputs.TRIAGE_EVENT_NAME == 'issues'
41
54
&&
42
55
(
43
- github.event.action == 'opened'
56
+ inputs.TRIAGE_EVENT_ACTION == 'opened'
44
57
||
45
- github.event.action == 'reopened'
58
+ inputs.TRIAGE_EVENT_ACTION == 'reopened'
46
59
||
47
- github.event.action == 'labeled'
60
+ inputs.TRIAGE_EVENT_ACTION == 'labeled'
48
61
||
49
- github.event.action == 'milestoned'
62
+ inputs.TRIAGE_EVENT_ACTION == 'milestoned'
50
63
||
51
- github.event.action == 'demilestoned'
64
+ inputs.TRIAGE_EVENT_ACTION == 'demilestoned'
52
65
||
53
- github.event.action == 'closed'
66
+ inputs.TRIAGE_EVENT_ACTION == 'closed'
54
67
||
55
- github.event.action == 'assigned'
68
+ inputs.TRIAGE_EVENT_ACTION == 'assigned'
56
69
)
57
70
)
58
71
||
59
72
(
60
- github.event_name == 'pull_request'
73
+ inputs.TRIAGE_EVENT_NAME == 'pull_request'
61
74
&&
62
75
(
63
- github.event.action == 'opened'
76
+ inputs.TRIAGE_EVENT_ACTION == 'opened'
64
77
||
65
- github.event.action == 'edited'
78
+ inputs.TRIAGE_EVENT_ACTION == 'edited'
66
79
||
67
- github.event.action == 'assigned'
80
+ inputs.TRIAGE_EVENT_ACTION == 'assigned'
68
81
||
69
- github.event.action == 'reopened'
82
+ inputs.TRIAGE_EVENT_ACTION == 'reopened'
70
83
||
71
- github.event.action == 'closed'
84
+ inputs.TRIAGE_EVENT_ACTION == 'closed'
72
85
)
73
86
)
74
87
)}}
85
98
project-remove :
86
99
name : Remove
87
100
if : ${{(
88
- github.event_name == 'issues' && github.event.action == 'transferred'
101
+ inputs.TRIAGE_EVENT_NAME == 'issues' && inputs.TRIAGE_EVENT_ACTION == 'transferred'
89
102
)}}
90
103
runs-on : ubuntu-latest
91
104
steps :
99
112
project-fields :
100
113
name : Field Values
101
114
if : ${{(
102
- (github.event_name == 'issues' && github.event.action != 'transferred')
115
+ (inputs.TRIAGE_EVENT_NAME == 'issues' && inputs.TRIAGE_EVENT_ACTION != 'transferred')
103
116
||
104
- (github.event_name == 'pull_request')
117
+ (inputs.TRIAGE_EVENT_NAME == 'pull_request')
105
118
)}}
106
119
needs :
107
120
- project-add
@@ -155,9 +168,9 @@ jobs:
155
168
name : Set Start Date
156
169
if : ${{(
157
170
(
158
- (github.event_name == 'issues' && github.event.action == 'assigned')
171
+ (inputs.TRIAGE_EVENT_NAME == 'issues' && inputs.TRIAGE_EVENT_ACTION == 'assigned')
159
172
||
160
- github.event_name == 'pull_request'
173
+ inputs.TRIAGE_EVENT_NAME == 'pull_request'
161
174
)
162
175
&&
163
176
needs.project-fields.outputs.project-start-date == ''
@@ -193,7 +206,7 @@ jobs:
193
206
194
207
195
208
- name : Set Status Planning
196
- if : ${{ github.event_name == 'issues' && github.event.action == 'milestoned' }}
209
+ if : ${{ inputs.TRIAGE_EVENT_NAME == 'issues' && inputs.TRIAGE_EVENT_ACTION == 'milestoned' }}
197
210
uses : EndBug/project-fields@v2
198
211
with :
199
212
operation : set
@@ -205,9 +218,9 @@ jobs:
205
218
206
219
- name : Set Status In Progress
207
220
if : ${{(
208
- (github.event_name == 'issues' && github.event.action == 'assigned')
221
+ (inputs.TRIAGE_EVENT_NAME == 'issues' && inputs.TRIAGE_EVENT_ACTION == 'assigned')
209
222
||
210
- github.event_name == 'pull_request' && github.event.action != 'closed'
223
+ inputs.TRIAGE_EVENT_NAME == 'pull_request' && inputs.TRIAGE_EVENT_ACTION != 'closed'
211
224
)}}
212
225
uses : EndBug/project-fields@v2
213
226
with :
@@ -219,7 +232,7 @@ jobs:
219
232
220
233
221
234
- name : Set Status done
222
- if : ${{ github.event.action == 'closed' }}
235
+ if : ${{ inputs.TRIAGE_EVENT_ACTION == 'closed' }}
223
236
uses : EndBug/project-fields@v2
224
237
with :
225
238
operation : set
@@ -232,9 +245,9 @@ jobs:
232
245
- name : Clear Status
233
246
if : ${{(
234
247
(
235
- (github.event_name == 'issues' && github.event.action == 'reopened')
248
+ (inputs.TRIAGE_EVENT_NAME == 'issues' && inputs.TRIAGE_EVENT_ACTION == 'reopened')
236
249
||
237
- (github.event_name == 'issues' && github.event.action == 'demilestoned')
250
+ (inputs.TRIAGE_EVENT_NAME == 'issues' && inputs.TRIAGE_EVENT_ACTION == 'demilestoned')
238
251
)
239
252
&&
240
253
needs.project_fields.project-status != 'Ready to Commence'
@@ -254,9 +267,9 @@ jobs:
254
267
needs.project-fields.outputs.project-start-date != ''
255
268
&&
256
269
(
257
- github.event.action == 'closed'
270
+ inputs.TRIAGE_EVENT_ACTION == 'closed'
258
271
||
259
- github.event.action == 'reopened'
272
+ inputs.TRIAGE_EVENT_ACTION == 'reopened'
260
273
)
261
274
)}}
262
275
needs :
@@ -267,7 +280,7 @@ jobs:
267
280
268
281
- name : Set End date
269
282
if : ${{(
270
- github.event.action == 'closed'
283
+ inputs.TRIAGE_EVENT_ACTION == 'closed'
271
284
&&
272
285
needs.project-fields.outputs.project-end-date == ''
273
286
)}}
@@ -282,7 +295,7 @@ jobs:
282
295
283
296
- name : Clear End Date
284
297
if : ${{(
285
- github.event_name == 'issues' && github.event.action == 'reopened'
298
+ inputs.TRIAGE_EVENT_NAME == 'issues' && inputs.TRIAGE_EVENT_ACTION == 'reopened'
286
299
)}}
287
300
uses : EndBug/project-fields@v2
288
301
with :
0 commit comments