Skip to content

Instantly share code, notes, and snippets.

@alaamub
Created December 20, 2023 16:14
Show Gist options
  • Save alaamub/fae34100c161f92b0cc2567b81d3578a to your computer and use it in GitHub Desktop.
Save alaamub/fae34100c161f92b0cc2567b81d3578a to your computer and use it in GitHub Desktop.
- name: Terraform Plan
id: plan
working-directory: ${{ env.ROOT_MODULE_PATH }}
# have to use /bin/bash because GHA runs by default with `set -e` to end execution on any error.
# we want to capture the error instead.
shell: "/bin/bash {0}"
run: |
set +e
terraform plan -out tfplan -detailed-exitcode > plan_output.txt 2>&1
EXIT_CODE=$?
cat plan_output.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment