Skip to content

Commit e07e62f

Browse files
authored
Merge pull request #179 from dflook/github_pr_comment_refactor
GitHub pr comment refactor
2 parents 1842b14 + 1857bf9 commit e07e62f

File tree

139 files changed

+2348
-1313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+2348
-1313
lines changed

.github/github_sucks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Everytime I need to generate a push or synchronise event I will touch this file.
22
This is usually because GitHub Actions has broken in some way.
3+

.github/workflows/pull_request_review.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
uses: ./terraform-plan
1818
with:
1919
label: pull_request_review
20-
path: tests/apply/changes
20+
path: tests/workflows/pull_request_review
2121

2222
- name: Apply
2323
uses: ./terraform-apply
2424
id: output
2525
with:
2626
label: pull_request_review
27-
path: tests/apply/changes
27+
path: tests/workflows/pull_request_review
2828

2929
- name: Verify outputs
3030
run: |

.github/workflows/pull_request_target.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
uses: ./terraform-plan
1818
with:
1919
label: pull_request_target
20-
path: tests/apply/changes
20+
path: tests/workflows/pull_request_target
2121

2222
- name: Apply
2323
uses: ./terraform-apply
2424
id: output
2525
with:
2626
label: pull_request_target
27-
path: tests/apply/changes
27+
path: tests/workflows/pull_request_target
2828

2929
- name: Verify outputs
3030
run: |

.github/workflows/test-apply.yaml

Lines changed: 67 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: ./terraform-apply
1919
id: output
2020
with:
21-
path: tests/remote-state/test-bucket_12
21+
path: tests/workflows/test-apply/remote
2222
auto_approve: true
2323

2424
- name: Verify outputs
@@ -50,7 +50,7 @@ jobs:
5050
id: apply
5151
continue-on-error: true
5252
with:
53-
path: tests/remote-state/test-bucket_12
53+
path: tests/workflows/test-apply/remote
5454
auto_approve: true
5555

5656
- name: Check failed to apply
@@ -89,16 +89,16 @@ jobs:
8989
- name: Plan
9090
uses: ./terraform-plan
9191
with:
92-
label: Apply Error
93-
path: tests/apply/apply-error
92+
label: test-apply apply_apply_error
93+
path: tests/workflows/test-apply/apply-error
9494

9595
- name: Apply
9696
uses: ./terraform-apply
9797
id: apply
9898
continue-on-error: true
9999
with:
100-
label: Apply Error
101-
path: tests/apply/apply-error
100+
label: test-apply apply_apply_error
101+
path: tests/workflows/test-apply/apply-error
102102

103103
- name: Check failed to apply
104104
run: |
@@ -134,7 +134,7 @@ jobs:
134134
id: apply
135135
continue-on-error: true
136136
with:
137-
path: tests/apply/changes
137+
path: tests/workflows/test-apply/changes
138138

139139
- name: Check failed to apply
140140
run: |
@@ -160,13 +160,15 @@ jobs:
160160
- name: Plan
161161
uses: ./terraform-plan
162162
with:
163-
path: tests/apply/changes
163+
label: test-apply apply
164+
path: tests/workflows/test-apply/changes
164165

165166
- name: Apply
166167
uses: ./terraform-apply
167168
id: first-apply
168169
with:
169-
path: tests/apply/changes
170+
label: test-apply apply
171+
path: tests/workflows/test-apply/changes
170172

171173
- name: Verify outputs
172174
run: |
@@ -189,7 +191,8 @@ jobs:
189191
uses: ./terraform-apply
190192
id: second-apply
191193
with:
192-
path: tests/apply/changes
194+
label: test-apply apply
195+
path: tests/workflows/test-apply/changes
193196

194197
- name: Verify outputs
195198
run: |
@@ -220,7 +223,8 @@ jobs:
220223
- name: Plan
221224
uses: ./terraform-plan
222225
with:
223-
path: tests/apply/vars
226+
label: test-apply apply_variables
227+
path: tests/workflows/test-apply/vars
224228
variables: |
225229
my_var="hello"
226230
complex_input=[
@@ -235,13 +239,14 @@ jobs:
235239
protocol = "tcp"
236240
},
237241
]
238-
var_file: tests/apply/test.tfvars
242+
var_file: tests/workflows/test-apply/test.tfvars
239243

240244
- name: Apply
241245
uses: ./terraform-apply
242246
id: output
243247
with:
244-
path: tests/apply/vars
248+
label: test-apply apply_variables
249+
path: tests/workflows/test-apply/vars
245250
variables: |
246251
my_var="hello"
247252
complex_input=[
@@ -256,7 +261,7 @@ jobs:
256261
protocol = "tcp"
257262
},
258263
]
259-
var_file: tests/apply/test.tfvars
264+
var_file: tests/workflows/test-apply/test.tfvars
260265

261266
- name: Verify outputs
262267
run: |
@@ -304,15 +309,17 @@ jobs:
304309
- name: Plan
305310
uses: ./terraform-plan
306311
with:
307-
path: tests/apply/backend_config_12
308-
backend_config_file: tests/apply/backend_config_12/backend_config
312+
label: test-apply backend_config_12 backend_config_file
313+
path: tests/workflows/test-apply/backend_config_12
314+
backend_config_file: tests/workflows/test-apply/backend_config_12/backend_config
309315

310316
- name: Apply
311317
uses: ./terraform-apply
312318
id: backend_config_file_12
313319
with:
314-
path: tests/apply/backend_config_12
315-
backend_config_file: tests/apply/backend_config_12/backend_config
320+
label: test-apply backend_config_12 backend_config_file
321+
path: tests/workflows/test-apply/backend_config_12
322+
backend_config_file: tests/workflows/test-apply/backend_config_12/backend_config
316323

317324
- name: Verify outputs
318325
run: |
@@ -334,7 +341,8 @@ jobs:
334341
- name: Plan
335342
uses: ./terraform-plan
336343
with:
337-
path: tests/apply/backend_config_12
344+
label: test-apply backend_config_12 backend_config
345+
path: tests/workflows/test-apply/backend_config_12
338346
backend_config: |
339347
bucket=terraform-github-actions
340348
key=backend_config
@@ -344,7 +352,8 @@ jobs:
344352
uses: ./terraform-apply
345353
id: backend_config_12
346354
with:
347-
path: tests/apply/backend_config_12
355+
label: test-apply backend_config_12 backend_config
356+
path: tests/workflows/test-apply/backend_config_12
348357
backend_config: |
349358
bucket=terraform-github-actions
350359
key=backend_config
@@ -381,15 +390,17 @@ jobs:
381390
- name: Plan
382391
uses: ./terraform-plan
383392
with:
384-
path: tests/apply/backend_config_13
385-
backend_config_file: tests/apply/backend_config_13/backend_config
393+
label: test-apply backend_config_12 backend_config_file
394+
path: tests/workflows/test-apply/backend_config_13
395+
backend_config_file: tests/workflows/test-apply/backend_config_13/backend_config
386396

387397
- name: Apply
388398
uses: ./terraform-apply
389399
id: backend_config_file_13
390400
with:
391-
path: tests/apply/backend_config_13
392-
backend_config_file: tests/apply/backend_config_13/backend_config
401+
label: test-apply backend_config_12 backend_config_file
402+
path: tests/workflows/test-apply/backend_config_13
403+
backend_config_file: tests/workflows/test-apply/backend_config_13/backend_config
393404

394405
- name: Verify outputs
395406
run: |
@@ -411,7 +422,8 @@ jobs:
411422
- name: Plan
412423
uses: ./terraform-plan
413424
with:
414-
path: tests/apply/backend_config_13
425+
label: test-apply backend_config_12 backend_config
426+
path: tests/workflows/test-apply/backend_config_13
415427
backend_config: |
416428
bucket=terraform-github-actions
417429
key=backend_config_13
@@ -421,7 +433,8 @@ jobs:
421433
uses: ./terraform-apply
422434
id: backend_config_13
423435
with:
424-
path: tests/apply/backend_config_13
436+
label: test-apply backend_config_12 backend_config
437+
path: tests/workflows/test-apply/backend_config_13
425438
backend_config: |
426439
bucket=terraform-github-actions
427440
key=backend_config_13
@@ -456,19 +469,19 @@ jobs:
456469
- name: Plan
457470
uses: ./terraform-plan
458471
with:
459-
path: tests/apply/vars
460-
label: TestLabel
472+
path: tests/workflows/test-apply/vars
473+
label: test-apply apply_label
461474
variables: my_var="world"
462-
var_file: tests/apply/test.tfvars
475+
var_file: tests/workflows/test-apply/test.tfvars
463476

464477
- name: Apply
465478
uses: ./terraform-apply
466479
id: output
467480
with:
468-
path: tests/apply/vars
469-
label: TestLabel
481+
path: tests/workflows/test-apply/vars
482+
label: test-apply apply_label
470483
variables: my_var="world"
471-
var_file: tests/apply/test.tfvars
484+
var_file: tests/workflows/test-apply/test.tfvars
472485

473486
- name: Verify outputs
474487
run: |
@@ -502,7 +515,7 @@ jobs:
502515
uses: ./terraform-apply
503516
id: output
504517
with:
505-
path: tests/remote-state/test-bucket_12
518+
path: tests/workflows/test-apply/remote
506519

507520
- name: Verify outputs
508521
run: |
@@ -536,7 +549,7 @@ jobs:
536549
id: apply
537550
continue-on-error: true
538551
with:
539-
path: tests/apply/no_plan
552+
path: tests/workflows/test-apply/no_plan
540553

541554
- name: Check failed to apply
542555
run: |
@@ -567,15 +580,15 @@ jobs:
567580
- name: Plan
568581
uses: ./terraform-plan
569582
with:
570-
label: User PAT
571-
path: tests/apply/changes
583+
label: test-apply apply_user_token
584+
path: tests/workflows/test-apply/changes
572585

573586
- name: Apply
574587
uses: ./terraform-apply
575588
id: output
576589
with:
577-
label: User PAT
578-
path: tests/apply/changes
590+
label: test-apply apply_user_token
591+
path: tests/workflows/test-apply/changes
579592

580593
- name: Verify outputs
581594
run: |
@@ -606,17 +619,17 @@ jobs:
606619
- name: Plan
607620
uses: ./terraform-plan
608621
with:
609-
path: tests/apply/vars
622+
path: tests/workflows/test-apply/deprecated_var
610623
var: my_var=hello
611-
var_file: tests/apply/test.tfvars
624+
var_file: tests/workflows/test-apply/test.tfvars
612625

613626
- name: Apply
614627
uses: ./terraform-apply
615628
id: output
616629
with:
617-
path: tests/apply/vars
630+
path: tests/workflows/test-apply/deprecated_var
618631
var: my_var=hello
619-
var_file: tests/apply/test.tfvars
632+
var_file: tests/workflows/test-apply/test.tfvars
620633

621634
- name: Verify outputs
622635
run: |
@@ -645,30 +658,30 @@ jobs:
645658
- name: Plan 1
646659
uses: ./terraform-plan
647660
with:
648-
label: Refresh 1
649-
path: tests/apply/refresh_15
661+
label: test-apply apply_refresh 1
662+
path: tests/workflows/test-apply/refresh_15
650663
variables: len=10
651664

652665
- name: Apply 1
653666
uses: ./terraform-apply
654667
with:
655-
label: Refresh 1
656-
path: tests/apply/refresh_15
668+
label: test-apply apply_refresh 1
669+
path: tests/workflows/test-apply/refresh_15
657670
variables: len=10
658671

659672
- name: Plan 2
660673
uses: ./terraform-plan
661674
with:
662-
label: Refresh 2
663-
path: tests/apply/refresh_15
675+
label: test-apply apply_refresh 2
676+
path: tests/workflows/test-apply/refresh_15
664677
variables: len=20
665678

666679
- name: Apply 2
667680
uses: ./terraform-apply
668681
id: output
669682
with:
670-
label: Refresh 2
671-
path: tests/apply/refresh_15
683+
label: test-apply apply_refresh 2
684+
path: tests/workflows/test-apply/refresh_15
672685
variables: len=20
673686

674687
apply_with_pre_run:
@@ -686,15 +699,15 @@ jobs:
686699
- name: Plan
687700
uses: ./terraform-plan
688701
with:
689-
label: pre-run
690-
path: tests/apply/changes
702+
label: test-apply apply_with_pre_run
703+
path: tests/workflows/test-apply/changes
691704

692705
- name: Apply
693706
uses: ./terraform-apply
694707
id: output
695708
with:
696-
label: pre-run
697-
path: tests/apply/changes
709+
label: test-apply apply_with_pre_run
710+
path: tests/workflows/test-apply/changes
698711

699712
- name: Verify outputs
700713
run: |

0 commit comments

Comments
 (0)