hashicorp / setup-terraform

Sets up Terraform CLI in your GitHub Actions workflow.
https://developer.hashicorp.com/terraform/tutorials/automation/github-actions
Mozilla Public License 2.0
1.38k stars 243 forks source link

Terraform state doesn't unlock if you cancel workflow running a terraform plan #441

Open arianvp opened 1 month ago

arianvp commented 1 month ago

Exactly what it says in the title. It seems the terraform wrapper isn't forwarding signals properly so the lock is never unclaimed. So when you cancel a workflow the lockfile needs to be manually cleaned up.

Dozens of people in this thread trying to come up with workarounds. But I think it's a bug in this action.

https://github.com/orgs/community/discussions/26311

austinvalle commented 1 month ago

Hey there @arianvp 👋🏻, had a look through that thread and I agree that should be something the wrapper could be adjusted to properly forward the signals. We do rely on the @actions/exec package for executing the terraform process, but looks like someone in the community was already looking at adding this passthrough to that package for use in setup-terraform:

If that PR gets merged and released, I think we'd be open for a PR to adjust the wrapper to forward those signals through.