Skip to content

The job should fail when tofu fails by default #101

@giner

Description

@giner

Here is an example which should fail the job however it doesn't

$ tofu fmt --recursive --diff --check; echo $?
╷
│ Error: Invalid expression
│ 
│   on repos/repos.tf line 26, in locals:
│   26:     .myrepo = {
│ 
│ Expected the start of an expression, but found an invalid expression token.
╵

2

presumably because of this

if (exitCode === 0 || exitCode === 2) {

One could argue that the default behavior should be for the job to fail if the executable fails. However, that isn't the case with the wrapper enabled by default. This leads to errors going unnoticed for a long time. I believe ignoring the exit code should be a conscious choice made by the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions