File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -626,3 +626,48 @@ jobs:
626626 exit 1
627627 fi
628628
629+ - name : Plan excluding resources without label
630+ uses : ./tofu-plan
631+ id : plan-exclude-no-label
632+ with :
633+ path : tests/workflows/test-target-replace-exclude
634+ exclude : |
635+ random_string.exclude_me
636+ variables : |
637+ length = 8
638+
639+ - name : Verify exclude plan without label
640+ env :
641+ CHANGES : ${{ steps.plan-exclude-no-label.outputs.changes }}
642+ run : |
643+ if [[ "$CHANGES" != "true" ]]; then
644+ echo "::error:: Exclude plan without label should have changes for non-excluded resources"
645+ exit 1
646+ fi
647+
648+ - name : Apply excluding resources without label
649+ uses : ./tofu-apply
650+ id : apply-exclude-no-label
651+ with :
652+ path : tests/workflows/test-target-replace-exclude
653+ exclude : |
654+ random_string.exclude_me
655+ variables : |
656+ length = 8
657+
658+ - name : Verify exclude apply without label
659+ env :
660+ EXCLUDE_ME : ${{ steps.apply-exclude-no-label.outputs.exclude_me }}
661+ KEEP_ME : ${{ steps.apply-exclude-no-label.outputs.keep_me }}
662+ run : |
663+ # Should NOT have created excluded resource
664+ if [[ "$EXCLUDE_ME" != "" ]]; then
665+ echo "::error:: exclude_me output should be empty (resource excluded without label)"
666+ exit 1
667+ fi
668+
669+ # Should have updated non-excluded resource
670+ if [[ "$KEEP_ME" == "" ]]; then
671+ echo "::error:: keep_me output should be set (resource not excluded without label)"
672+ exit 1
673+ fi
You can’t perform that action at this time.
0 commit comments