This repository was archived by the owner on May 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -5,23 +5,26 @@ function terraformApply {
55 echo " apply: info: applying Terraform configuration in ${tfWorkingDir} "
66 applyOutput=$( terraform apply -auto-approve -input=false 2>&1 )
77 applyExitCode=${?}
8+ applyCommentStatus=" Failed"
89
910 # Exit code of 0 indicates success. Print the output and exit.
1011 if [ ${applyExitCode} -eq 0 ]; then
1112 echo " apply: info: successfully applied Terraform configuration in ${tfWorkingDir} "
1213 echo " ${applyOutput} "
1314 echo
14- exit ${applyExitCode}
15+ applyCommentStatus= " Success "
1516 fi
1617
1718 # Exit code of !0 indicates failure.
18- echo " apply: error: failed to apply Terraform configuration in ${tfWorkingDir} "
19- echo " ${applyOutput} "
20- echo
19+ if [ ${applyExitCode} -ne 0 ]; then
20+ echo " apply: error: failed to apply Terraform configuration in ${tfWorkingDir} "
21+ echo " ${applyOutput} "
22+ echo
23+ fi
2124
2225 # Comment on the pull request if necessary.
2326 if [ " $GITHUB_EVENT_NAME " == " pull_request" ] && [ " ${tfComment} " == " 1" ]; then
24- applyCommentWrapper=" #### \` terraform apply\` Failed
27+ applyCommentWrapper=" #### \` terraform apply\` ${applyCommentStatus}
2528<details><summary>Show Output</summary>
2629
2730\`\`\`
You can’t perform that action at this time.
0 commit comments