hashicorp / hashicorp/setup-terraform

Wrapper suppresses exit code 2 even when it is an error

Open
#328 8 comments 5 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.6k
Forks
288
Avg merge
23h 21m
Merged PRs (30d)
3

Description

In https://github.com/hashicorp/setup-terraform/pull/125 the wrapper was updated to consider an exit code of 2 to be a success, because of a quirk of the `plan` command. But `fmt` can also return exit code 2, and it is not considered a success in that case. An example is if you call `terraform fmt -check -recursive ` and `` is not present. In that case a GitHub action running that command will succeed (if you use the wrapper) even though the command failed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the wrapper change described in pull request 125 and reproduce `terraform fmt -check -recursive ` with a missing directory. Done means an exit code of 2 from `fmt` still fails the GitHub Actions command, while the existing `plan` behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript, terraform
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.