Skip to content

Commit

Permalink
update speculative workflow template to include run status check step
Browse files Browse the repository at this point in the history
  • Loading branch information
mjyocca committed Jul 26, 2023
1 parent c5b1947 commit fb84384
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions workflow-templates/terraform-cloud.speculative-run.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:

- uses: hashicorp/tfc-workflows-github/actions/create-run@v1.0.3
id: run
## run may fail, if so continue to output PR comment
## step.terraform-cloud-check-run-status will fail job after pr comment is created/updated.
continue-on-error: true
with:
workspace: ${{ env.TF_WORKSPACE }}
configuration_version: ${{ steps.upload.outputs.configuration_version_id }}
Expand Down Expand Up @@ -97,3 +100,11 @@ jobs:
})
}
## Check Run Status, if not planned_and_finished fail the job
- id: terraform-cloud-check-run-status
if: ${{ steps.run.outputs.run_status != 'planned_and_finished'}}
run: |
echo "Terraform Cloud Run Failed or Requires Further Attention"
echo "Run Status: '${{ steps.run.outputs.run_status }}'"
echo "${{ steps.run.outputs.run_link }}"
exit 1

0 comments on commit fb84384

Please sign in to comment.