File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 7
7
description : ' Runner JSON string'
8
8
default : ' "ubuntu-latest"'
9
9
type : string
10
+ outputs :
11
+ tf_plan_exit_code :
12
+ description : ' OpenTofu Plan exit code'
13
+ value : ${{ jobs.tofu-plan.outputs.tf_plan_exit_code }}
14
+ tf_destroy :
15
+ description : ' Destroy flag'
16
+ value : ${{ jobs.tofu-plan.outputs.tf_destroy }}
10
17
11
18
# Special permissions required for OIDC authentication
12
19
permissions :
29
36
ARM_USE_OIDC : true
30
37
TF_DESTROY : " ${{ vars.TF_DESTROY }}"
31
38
outputs :
32
- tf-plan-exit-code : ${{ steps.tf-plan.outputs.exitcode }}
39
+ tf_plan_exit_code : ${{ steps.tf-plan.outputs.exitcode }}
40
+ tf_destroy : ${{ steps.tf-plan.outputs.tf_destroy }}
33
41
34
42
steps :
35
43
# Checkout the repository to the GitHub Actions runner
68
76
-out tfplan || export exitcode=$?
69
77
70
78
echo "exitcode=$exitcode" >> $GITHUB_OUTPUT
79
+ echo "tf_destroy=${{ env.TF_DESTROY }}" >> $GITHUB_OUTPUT
71
80
72
81
if [ $exitcode -eq 1 ]; then
73
82
echo OpenTofu Plan Failed!
87
96
tofu-apply :
88
97
name : ' OpenTofu Apply'
89
98
needs : [tofu-plan]
90
- if : ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && needs.tofu-plan.outputs.tf-plan-exit-code == 2 }}
99
+ if : ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && needs.tofu-plan.outputs.tf_plan_exit_code == 2 }}
91
100
runs-on : ${{ fromJSON(inputs.runs_on) }}
92
101
environment : ${{ github.ref_name }}
93
102
env :
You can’t perform that action at this time.
0 commit comments