20
20
default : " ${{ github.event_name }}"
21
21
description : Name of event that triggered to workflow
22
22
type : string
23
+ TRIAGE_ITEM_URL :
24
+ required : false
25
+ default : " none"
26
+ description : URL of the item that triggered the workflow (issue/PR)
27
+ type : string
23
28
secrets :
24
29
WORKFLOW_TOKEN :
25
30
description : Token used to with permission to the project
46
51
echo "[Debug] inputs.TRIAGE_EVENT_NAME=${{ inputs.TRIAGE_EVENT_NAME }}";
47
52
48
53
54
+ prepare :
55
+ name : Preparation
56
+ runs-on : ubuntu-latest
57
+ outputs :
58
+ triage_item_url : ${{ steps.triage_item_url.outputs.triage_item_url }}
59
+ steps :
60
+
61
+
62
+ - name : Build Item URL
63
+ id : triage_item_url
64
+ shell : bash
65
+ run : |
66
+
67
+ if [ "${{ inputs.TRIAGE_ITEM_URL }}" == "none" ]; then
68
+
69
+ if [ "${{inputs.TRIAGE_EVENT_NAME }}" == 'pull_request' ]; then
70
+
71
+ echo "triage_item_url=https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}" > $GITHUB_OUTPUT;
72
+
73
+ else
74
+
75
+ echo "triage_item_url=https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}" > $GITHUB_OUTPUT;
76
+
77
+ fi;
78
+
79
+ else
80
+
81
+ echo "triage_item_url=${{ inputs.TRIAGE_ITEM_URL }}" > $GITHUB_OUTPUT;
82
+
83
+ fi;
84
+
85
+
49
86
project-add :
50
87
name : Add
88
+ needs :
89
+ - prepare
51
90
if : ${{(
52
91
(
53
92
inputs.TRIAGE_EVENT_NAME == 'issues'
@@ -117,6 +156,7 @@ jobs:
117
156
(inputs.TRIAGE_EVENT_NAME == 'pull_request')
118
157
)}}
119
158
needs :
159
+ - prepare
120
160
- project-add
121
161
runs-on : ubuntu-latest
122
162
outputs :
@@ -141,6 +181,7 @@ jobs:
141
181
fields : Start date
142
182
github_token : ${{ secrets.WORKFLOW_TOKEN }}
143
183
project_url : ${{ inputs.PROJECT_URL }}
184
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
144
185
145
186
146
187
- name : Fetch End Date
@@ -151,6 +192,7 @@ jobs:
151
192
fields : End date
152
193
github_token : ${{ secrets.WORKFLOW_TOKEN }}
153
194
project_url : ${{ inputs.PROJECT_URL }}
195
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
154
196
155
197
156
198
- name : Fetch Status
@@ -161,6 +203,7 @@ jobs:
161
203
fields : Status
162
204
github_token : ${{ secrets.WORKFLOW_TOKEN }}
163
205
project_url : ${{ inputs.PROJECT_URL }}
206
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
164
207
165
208
166
209
@@ -176,6 +219,7 @@ jobs:
176
219
needs.project-fields.outputs.project-start-date == ''
177
220
)}}
178
221
needs :
222
+ - prepare
179
223
- project-fields
180
224
runs-on : ubuntu-latest
181
225
steps :
@@ -188,6 +232,7 @@ jobs:
188
232
fields : Start date
189
233
github_token : ${{ secrets.WORKFLOW_TOKEN }}
190
234
project_url : ${{ inputs.PROJECT_URL }}
235
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
191
236
values : ${{ needs.project-fields.outputs.date-value }}
192
237
193
238
@@ -200,6 +245,7 @@ jobs:
200
245
needs.project-fields.outputs.project-status != 'In progress'
201
246
)}}
202
247
needs :
248
+ - prepare
203
249
- project-fields
204
250
runs-on : ubuntu-latest
205
251
steps :
@@ -213,6 +259,7 @@ jobs:
213
259
fields : Status
214
260
github_token : ${{ secrets.WORKFLOW_TOKEN }}
215
261
project_url : ${{ inputs.PROJECT_URL }}
262
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
216
263
values : ' Planning'
217
264
218
265
@@ -228,6 +275,7 @@ jobs:
228
275
fields : Status
229
276
github_token : ${{ secrets.WORKFLOW_TOKEN }}
230
277
project_url : ${{ inputs.PROJECT_URL }}
278
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
231
279
values : ' In progress'
232
280
233
281
@@ -239,6 +287,7 @@ jobs:
239
287
fields : Status
240
288
github_token : ${{ secrets.WORKFLOW_TOKEN }}
241
289
project_url : ${{ inputs.PROJECT_URL }}
290
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
242
291
values : ' Done'
243
292
244
293
@@ -258,6 +307,7 @@ jobs:
258
307
fields : Status
259
308
github_token : ${{ secrets.WORKFLOW_TOKEN }}
260
309
project_url : ${{ inputs.PROJECT_URL }}
310
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
261
311
262
312
263
313
@@ -273,6 +323,7 @@ jobs:
273
323
)
274
324
)}}
275
325
needs :
326
+ - prepare
276
327
- project-fields
277
328
runs-on : ubuntu-latest
278
329
steps :
@@ -290,6 +341,7 @@ jobs:
290
341
fields : End date
291
342
github_token : ${{ secrets.WORKFLOW_TOKEN }}
292
343
project_url : ${{ inputs.PROJECT_URL }}
344
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
293
345
values : ${{ needs.project-fields.outputs.date-value }}
294
346
295
347
@@ -303,3 +355,4 @@ jobs:
303
355
fields : End date
304
356
github_token : ${{ secrets.WORKFLOW_TOKEN }}
305
357
project_url : ${{ inputs.PROJECT_URL }}
358
+ resource_url : ${{ needs.prepare.outputs.triage_item_url }}
0 commit comments