liatrio / terraform-change-pr-commenter

GitHub Action to read changes from Terraform plan JSON, summarize changes, and post them in a GitHub Pull Request Comment
Apache License 2.0
37 stars 8 forks source link

Action fails on plans with no changes #30

Closed stevie- closed 2 years ago

stevie- commented 2 years ago

If we pass a plan with no changes to this action we get an error.

Run liatrio/terraform-change-pr-commenter@v1.3.1
  with:
    json-file: /home/runner/work/terragrunt-action/terragrunt-action/examples/test-pr-comment-terragrunt-no-change/test-no-change/tfplan.json

    github-token: ***
    expand-comment: false
  env:
    TERRAFORM_VERSION: 1.1.9
    TERRAGRUNT_VERSION: 0.37.1
Found PR # 7 from workflow context - proceeding to comment.
Error: resource_changes is not iterable

We can reproduce it with an empty main.tf: https://github.com/datadrivers/terragrunt-action/runs/6811210907?check_suite_focus=true#step:3:243

RobertKelly commented 2 years ago

Thanks for reporting. Must have escaped the last refactor test scenario. We'll get this corrected.

liatrio-bot commented 2 years ago

:tada: This issue has been resolved in version 1.3.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

stevie- commented 2 years ago

thank you, works now https://github.com/datadrivers/terragrunt-action/pull/8