Skip to content

Commit de8d9f6

Browse files
Merge pull request #3671 from nhsuk/improve_visibility_into_tf_plan
Improve error visibility in pipeline
2 parents e698950 + 8de64dd commit de8d9f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/deploy-infrastructure.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ jobs:
156156
terraform init -backend-config="env/${{ inputs.environment }}-backend.hcl" -upgrade
157157
terraform plan -var="image_digest=$DIGEST" -var="app_version=${{ env.git_ref_to_deploy }}" \
158158
-var-file="env/${{ inputs.environment }}.tfvars" \
159-
-out ${{ runner.temp }}/tfplan &> ${{ runner.temp }}/tf_stdout
160-
TF_EXIT_CODE=$?
159+
-out ${{ runner.temp }}/tfplan | tee ${{ runner.temp }}/tf_stdout
160+
TF_EXIT_CODE=${PIPESTATUS[0]}
161161
cat ${{ runner.temp }}/tf_stdout
162162
if [ $TF_EXIT_CODE -eq 1 ]; then
163163
exit $TF_EXIT_CODE

0 commit comments

Comments
 (0)