learn-terraform-github-actions icon indicating copy to clipboard operation
learn-terraform-github-actions copied to clipboard

No output in "Show Plan" When using terragrunt

Open pratik-ixfi opened this issue 2 years ago • 2 comments

Hello i am using terragrunt so on Show output there is no output caputured so can anyone help me

   - name: Plan Terraform
      id: plan
      if: github.event_name == 'pull_request'
      working-directory: infra/config/pci/stage
      run: terragrunt run-all plan --terragrunt-non-interactive -no-color -input=false
      continue-on-error: true

    - name: Update Pull Request
      uses: actions/github-script@v6
      if: github.event_name == 'pull_request'
      env:
        PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        script: |
          const output = `#### Terraform Format and Style 🖌\`${{ needs.lint.outputs.output }}\`
          #### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
          #### Terraform Validation 🤖\`${{ needs.validate.outputs.output }}\`
          #### Terraform Plan 📖\`${{ steps.plan.outcome }}\`

          <details><summary>Show Plan</summary>

          \`\`\`\n
          ${process.env.PLAN}
          \`\`\`

          </details>

          *Pushed by: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;

          github.rest.issues.createComment({
            issue_number: context.issue.number,
            owner: context.repo.owner,
            repo: context.repo.repo,
            body: output
          })
    
    - name: Terraform Plan Status
      if: steps.plan.outcome == 'failure'
      run: exit 1

pratik-ixfi avatar Mar 14 '23 18:03 pratik-ixfi

Screenshot 2023-03-14 at 11 46 14 PM

pratik-ixfi avatar Mar 14 '23 18:03 pratik-ixfi

@palakag29

Killer2-O avatar Jul 03 '23 17:07 Killer2-O