Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when redirecting tg command to file #40

Open
1 task
thisurawijesekera opened this issue Nov 29, 2023 · 1 comment
Open
1 task

Error when redirecting tg command to file #40

thisurawijesekera opened this issue Nov 29, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@thisurawijesekera
Copy link

thisurawijesekera commented Nov 29, 2023

Describe the bug
Failed when trying to redirect tg command to file

To Reproduce
When try to redirect tg_command output to a file

    - name: Run Terragrunt Plan Json output
      if: ${{ inputs.ACTION == 'plan' }}    
      uses: gruntwork-io/[email protected]
      with:
        tf_version: ${{ env.TERRAFORM_VERSION }}
        tg_version: ${{ env.TERRAGRUNT_VERSION }}
        tg_dir: vars/${{ env.ENVIRONMENT }}
        tg_command: 'show -json  output.tfplan > tfplan.json'

    - name: Run Terragrunt Plan txt output 
      if: ${{ inputs.ACTION == 'plan' }}    
      uses: gruntwork-io/[email protected]
      with:
        tf_version: ${{ env.TERRAFORM_VERSION }}
        tg_version: ${{ env.TERRAGRUNT_VERSION }}
        tg_dir: vars/${{ env.ENVIRONMENT }}
        tg_command: 'show --no-color  output.tfplan  2>&1 > tfplan.txt'

Expected behavior
Should be able to redirect to a file. Can do it locally.

Nice to have

  • Terminal output
    image

Versions

  • Terragrunt Action version: v1.0.10
  • Environment details (Terragrunt version, Terraform version, etc.): TERRAFORM_VERSION: 1.6.5
    TERRAGRUNT_VERSION: 0.53.8
@thisurawijesekera thisurawijesekera added the bug Something isn't working label Nov 29, 2023
@GuillaumeFalourd
Copy link

This error may happen because the command is already redirected to a temporary file in the action (check https://github.com/gruntwork-io/terragrunt-action/blob/b055fa001b7487f9f524596777182af5f9bf712b/src/main.sh#L61C38-L61C65)

What could be done eventually is to add an optional input to the action, for the user to inform this temporary file name to gather this specific command output, for the user to manipulate in later steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants