forked from githubtraining/write-docker-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
892 lines (863 loc) · 31.8 KB
/
config.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
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
title: 'GitHub Actions: Write Docker container actions'
description: >-
Learn how to write your own GitHub Docker container action! This course will
empower you to begin automating customized tasks unique to your workflow.
template:
repo: 'write-docker-actions-template'
name: 'write-docker-actions'
tags:
- Docker
- Containers
- Workflows
- Application programming interface (API)
- Publishing GitHub Actions
# Repo artifacts
# 1. (Issue) Start here!
# 2. (PR) Create my first workflow
# 3. (Issue) Your first Docker based action
# 4. (PR) Add a Hello World action
# 5. (Issue) Kittens everywhere
# 6. (PR) External APIs
# 7. (Issue) Consuming action outputs
# 8. (PR) Use outputs
# 9. (Issue) Last minute notes
before:
- type: updateBranchProtection
- type: createLabel
name: first-cat-fact
color: FFBD33
- type: createLabel
name: second-cat-fact
color: 33FFBD
- type: createLabel
name: third-cat-fact
color: 3F8A99
- type: createIssue
title: Start here!
body: 01_welcome-issue.md
action_id: welcomeIssue
- type: respond
issue: '%actions.welcomeIssue.data.number%'
with: 01_welcome-activity.md
data:
quicklink: '%payload.repository.html_url%/new/main?filename=.github/workflows/my-workflow.yml&workflow_template=blank'
actionsUrl: '%payload.repository.html_url%/actions/new'
steps:
- title: Setup a workflow file
description: Create a pull request to add a workflow
event:
- pull_request.opened
- pull_request.edited
link: '{{ repoUrl }}/issues/1'
actions:
# if the pull request title equals 'Create my first workflow'
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Create my first workflow
# if those statments FAIL... do this
else:
- type: respond
with: e-rename-pr.md
data:
title: Create my first workflow
# if those gates === true Then do this stuff
- type: respond
issue: Start here!
with: new-pull-request.md
data:
pullUrl: '%payload.pull_request.html_url%'
- type: closeIssue
issue: Start here!
- type: respond
with: 01_explain-workflow.md
data:
actionsUrl: '%payload.repository.html_url%/actions'
- type: respond
with: 01_explain-environment.md
- type: respond
with: 01_explain-syntax.md
- type: respond
with: 02_explain-steps.md
- type: respond
with: 02_modify-workflow.md
issue: Create my first workflow
data:
workflowFile: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/.github/workflows/my-workflow.yml'
- title: Edit the current workflow
description: Remove boilerplate steps from `my-workflow.yml`
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/2'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Create my first workflow
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Create my first workflow**
- type: getPullRequest
pullRequest: Create my first workflow
action_id: workflowPr
- type: respond
with: 03_reference-actions.md
data:
workflowFile: '%payload.repository.html_url%/edit/%actions.workflowPr.data.head.ref%/.github/workflows/my-workflow.yml'
- title: Add an action reference to the workflow
description: Reference our custom action from `my-workflow.yml`
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/2'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Create my first workflow
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Create my first workflow**
- type: createIssue
title: Your first Docker based action
body: docker-overview.md
action_id: dockerOverview
data:
actionsUrl: '%payload.repository.html_url%/actions/new'
quicklink: '%payload.repository.html_url%/new/main?filename=.github/actions/hello-world/action.yml'
comments:
- 05_explain-actions.md
- 05_explain-metadata.md
- 05_create-metadata.md
- type: createReview
event: APPROVE
body: 04_on-to-actions.md
data:
issueUrl: '%actions.dockerOverview.data.html_url%'
pullRequest: Create my first workflow
- type: mergePullRequest
- title: Create the action metadata
description: Create an `action.yml` file and add necessary metadata
event:
- pull_request.opened
- pull_request.edited
link: '{{ repoUrl }}/issues/3'
actions:
# if the pull request title equals 'Add a Hello World action'
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Add a Hello World action
# if those statments FAIL... do this
else:
- type: respond
with: e-rename-pr.md
data:
title: Add a Hello World action
# if those gates === true Then do this stuff
- type: respond
with: 06_hello-docker-actions.md
action_id: helloPr
data:
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/hello-world/main.go'
# actionsUrl: '%payload.repository.html_url%/actions'
- type: respond
with: 05_hello-pr.md
issue: Your first Docker based action
data:
pullUrl: '%actions.helloPr.data.html_url%'
- type: closeIssue
issue: Your first Docker based action
- title: Write the Hello World source code
description: Create `main.go` containing the Hello World source code
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/4'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Add a Hello World action
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Add a Hello World action**
#######################################################
# Validate the filepath for the main.go file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/hello-world/main.go'
else:
# if file isn't where expected find true location
- type: findInTree
path: main.go
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/hello-world/main.go'
editLink: '%payload.repository.html_url%/edit/hello-world/%actions.fileLocation.path%'
fileName: main.go
# End filepath verification
#######################################################
- type: respond
with: 07_create-dockerfile.md
data:
actionsUrl: '%payload.repository.html_url%/actions'
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/hello-world/Dockerfile'
- title: Create the action's `Dockerfile`
description: Create a `Dockerfile` containing the Docker instructions
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/4'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Add a Hello World action
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Add a Hello World action**
#######################################################
# Validate the filepath for the main.go file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/hello-world/Dockerfile'
else:
# if file isn't where expected find true location
- type: findInTree
path: Dockerfile
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/hello-world/Dockerfile'
editLink: '%payload.repository.html_url%/edit/hello-world/%actions.fileLocation.path%'
fileName: Dockerfile
# End filepath verification
#######################################################
- type: respond
with: 07_hello-result.md
data:
actionsUrl: '%payload.repository.html_url%/actions'
- type: respond
with: 07_add-input-params.md
- type: respond
with: 07_update-metadata.md
data:
quicklink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/.github/actions/hello-world/action.yml'
- title: Add input parameters to Hello World's metadata
description: Update `action.yml` to accept input parameters for Hello World
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/4'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Add a Hello World action
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Add a Hello World action**
- type: respond
with: 07_update-source-code.md
data:
quicklink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/.github/actions/hello-world/main.go'
- title: Use input parameters in the source code
description: Extend Hello World's source code to accept the input parameters
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/4'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Add a Hello World action
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Add a Hello World action**
- type: respond
with: 07_update-workflow.md
data:
quicklink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/.github/workflows/my-workflow.yml'
- title: Use input parameters in the workflow
description: Assign values to the newly created input parameters in `my-workflow.yml`
event: pull_request.synchronize #ideally would like workflow complete to trigger this
link: '{{ repoUrl }}/pull/4'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Add a Hello World action
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Add a Hello World action**
- type: respond
with: 08_input-result.md
data:
actionsUrl: '%payload.repository.html_url%/actions'
- type: removeBranchProtection
- type: respond
with: 08_experiment.md
- title: Explore your input parameters
description: View the results of changing input parameters
event: pull_request.closed
link: '{{ repoUrl }}/pull/4'
actions:
- type: gate
every: true
gates:
- left: '%payload.pull_request.merged'
- left: '%payload.pull_request.title%'
operator: ===
right: Add a Hello World action
else:
- type: respond
with: e-generic.md
data:
expected: merge a pull request titled **Add a Hello World action**
- type: updateBranchProtection
- type: createIssue
body: 09_external-apis.md
title: Kittens everywhere
action_id: catFact
data:
actionsUrl: '%payload.repository.html_url%/actions'
workflowFile: '%payload.repository.html_url%/edit/main/.github/workflows/my-workflow.yml'
comments:
- 09_new-action.md
- type: respond
with: 08_next-steps.md
issue: Add a Hello World action
data:
issueUrl: '%actions.catFact.data.html_url%'
- title: Setting up the next action
description: Comment out the lines in the workflow to prevent unwanted runs
event:
- pull_request.opened
- pull_request.edited
link: '{{ repoUrl }}/issues/5'
actions:
# if the pull request title equals 'Create my first workflow'
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: External APIs
# if those statments FAIL... do this
else:
- type: respond
with: e-rename-pr.md
data:
title: External APIs
# if those gates === true Then do this stuff
- type: respond
issue: Kittens everywhere
with: new-pull-request.md
data:
pullUrl: '%payload.pull_request.html_url%'
- type: closeIssue
issue: Kittens everywhere
- type: respond
with: 10_create-metadata.md
data:
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/cat-facts/action.yml'
- title: Add metadata to the cat-fats action
description: Create the cat-facts metadata file
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/6'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: External APIs
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **External APIs**
#######################################################
# Validate the filepath for the action.yml file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/cat-facts/action.yml'
else:
# if file isn't where expected find true location
- type: findInTree
path: action.yml
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/cat-facts/action.yml'
editLink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%'
fileName: action.yml
# End filepath verification
#######################################################
- type: respond
with: 10_create-python-file.md
data:
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/cat-facts/src/main.py'
- title: Fetch a cat fact
description: Create the Python source code for the cat-fats action
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/6'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: External APIs
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **External APIs**
#######################################################
# Validate the filepath for the main.py file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/cat-facts/src/main.py'
else:
# if file isn't where expected find true location
- type: findInTree
path: main.py
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/cat-facts/src/main.py'
editLink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%'
fileName: main.py
# End filepath verification
#######################################################
- type: respond
with: 10_create-requirements.md
data:
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/cat-facts/requirements.txt'
- title: Add Python dependencies
description: Create `requirements.txt` with your Python dependencies
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/6'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: External APIs
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **External APIs**
#######################################################
# Validate the filepath for the requirements.txt file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/cat-facts/requirements.txt'
else:
# if file isn't where expected find true location
- type: findInTree
path: requirements.txt
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/cat-facts/requirements.txt'
editLink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%'
fileName: requirements.txt
# End filepath verification
#######################################################
- type: respond
with: 10_create-dockerfile.md
data:
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/cat-facts/Dockerfile'
- title: Add the cat-fact `Dockerfile`
description: Create `Dockerfile` for the cat-fat action
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/6'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: External APIs
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **External APIs**
#######################################################
# Validate the filepath for the Dockerfile file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/cat-facts/Dockerfile'
else:
# if file isn't where expected find true location
- type: findInTree
path: Dockerfile
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/cat-facts/Dockerfile'
editLink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%'
fileName: Dockerfile
# End filepath verification
#######################################################
- type: getPullRequest
pullRequest: External APIs
action_id: apiPr
- type: respond
with: 11_edit-workflow.md
data:
workflowFile: '%payload.repository.html_url%/edit/%actions.apiPr.data.head.ref%/.github/workflows/my-workflow.yml'
actionsUrl: '%payload.repository.html_url%/actions'
- title: Use the cat-fat action
description: Restore the workflow file
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/6'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: External APIs
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **External APIs**
- type: removeBranchProtection
- type: respond
with: 12_trigger-workflow.md
issue: External APIs
data:
actionsUrl: '%payload.repository.html_url%/actions'
- title: Get ready to purr
description: Trigger a cat fact
event: pull_request.closed
link: '{{ repoUrl }}/pull/6'
actions:
- type: gate
every: true
gates:
- left: '%payload.pull_request.merged'
- left: '%payload.pull_request.title%'
operator: ===
right: External APIs
else:
- type: respond
with: e-generic.md
data:
expected: merge a pull request titled **External APIs**
- type: updateBranchProtection
- type: createIssue
body: 13_action-three-workflow.md
title: Consuming action outputs
action_id: outputIssue
data:
actionsUrl: '%payload.repository.html_url%/actions'
workflowFile: '%payload.repository.html_url%/edit/main/.github/workflows/my-workflow.yml'
- type: respond
with: 12_next-steps.md
issue: External APIs
data:
issueUrl: '%actions.outputIssue.data.html_url%'
- title: Reference the issue-maker action
description: Reference issue-maker in the `my-workflow.yml`
event:
- pull_request.opened
- pull_request.edited
link: '{{ repoUrl }}/issues/7'
actions:
# if the pull request title equals 'Create my first workflow'
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Use outputs
# if those statments FAIL... do this
else:
- type: respond
with: e-rename-pr.md
data:
title: Use outputs
# if those gates === true Then do this stuff
- type: respond
issue: Consuming action outputs
with: new-pull-request.md
data:
pullUrl: '%payload.pull_request.html_url%'
- type: closeIssue
issue: Consuming action outputs
- type: respond
with: 14_action-three.md
data:
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/issue-maker/package.json'
- title: Add dependencies for issue-maker action
description: Add `package.json` to issue-maker
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/8'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Use outputs
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Use outputs**
#######################################################
# Validate the filepath for the requirements.txt file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/issue-maker/package.json'
else:
# if file isn't where expected find true location
- type: findInTree
path: package.json
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/issue-maker/package.json'
editLink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%'
fileName: package.json
# End filepath verification
#######################################################
- type: respond
with: 14_create-metadata.md
data:
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/issue-maker/action.yml'
- title: Create the issue-maker's action metadata
description: Add `action.yml` for issue-maker
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/8'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Use outputs
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Use outputs**
#######################################################
# Validate the filepath for the action.yml file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/issue-maker/action.yml'
else:
# if file isn't where expected find true location
- type: findInTree
path: action.yml
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/issue-maker/action.yml'
editLink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%'
fileName: action.yml
# End filepath verification
#######################################################
- type: respond
with: 14_create-js-files.md
data:
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/issue-maker/src/index.js'
- title: Add the issue-maker action's source code
description: Add `src/index.js` for issue-maker
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/8'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Use outputs
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Use outputs**
#######################################################
# Validate the filepath for the action.yml file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/issue-maker/src/index.js'
else:
# if file isn't where expected find true location
- type: findInTree
path: index.js
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/issue-maker/src/index.js'
editLink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%'
fileName: index.js
# End filepath verification
#######################################################
- type: respond
with: 14_create-dockerfile.md
data:
quicklink: '%payload.repository.html_url%/new/%payload.pull_request.head.ref%?filename=.github/actions/issue-maker/Dockerfile'
- title: Add the issue-maker action's `Dockerfile`
description: Create `Dockerfile` for issue-maker
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/8'
actions:
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Use outputs
else:
- type: respond
with: e-generic.md
data:
expected: a commit to a pull request titled **Use outputs**
#######################################################
# Validate the filepath for the action.yml file
# get tree
- type: getTree
action_id: isInTree
recursive: true
sha: '%payload.pull_request.head.sha%'
# check for a file in a tree
- type: gate
left: '%actions.isInTree.data.tree%'
operator: includes
right: 'path:.github/actions/issue-maker/Dockerfile'
else:
# if file isn't where expected find true location
- type: findInTree
path: Dockerfile
tree: '%actions.isInTree.data.tree%'
# multiple: true
action_id: fileLocation
# help user with proper file location
- type: respond
with: e-wrong-file-location.md
data:
haveFile: '%actions.fileLocation.path%'
needFile: '.github/actions/issue-maker/Dockerfile'
editLink: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%'
fileName: Dockerfile
# End filepath verification
#######################################################
- type: removeBranchProtection
- type: createIssue
title: Last minute notes
body: great-job.md
action_id: allDone
- type: respond
with: 15_add-a-label.md
data:
actionsUrl: '%payload.repository.html_url%/actions'
issueUrl: '%actions.allDone.data.html_url%'
- type: respond
issue: '%actions.allDone.data.number%'
with: 16_publishing.md
- type: respond
issue: '%actions.allDone.data.number%'
with: 16_complete.md