When my terraform code failed locally, I am able to see a detailed error message as to why it failed and with that information able to fix it. However, when the same terraform code failed while using GitHub Action workflow, it doesn’t give detailed reason why it failed, except “error exit code 1”. How can I use terraform debugging on the workflow level to produce detail log only when a step failed. I don’t want to configure debugging at the repository level.
name: Testing push to branches
on:
push:
branches-ignore:
- main
env:
TERRAFORM_VERSION: "latest"
TERRAGRUNT_VERSION: "latest"
TERRAFORM_WORKING_DIR: './test'
jobs:
plan:
name: "Terragrunt Plan"
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ${{ env.TERRAFORM_WORKING_DIR }}
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1.3.2
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: true
- name: Setup Terragrunt
uses: autero1/action-terragrunt@v1.1.0
with:
terragrunt_version: ${{ env.TERRAGRUNT_VERSION }}
- name: configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1.6.1
with:
aws-region: us-east-1
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Terragrunt Init
id: init
run: terragrunt run-all init -no-color --terragrunt-non-interactive