mirror of
https://github.com/opentofu/setup-opentofu.git
synced 2026-11-26 18:30:54 +01:00
fix: drop the success behavior for -detailed-exitcode==2
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
This commit is contained in:
2 files changed
+10
-12
No files matched your search
Vendored
+5
-6
@@ -30971,15 +30971,14 @@ async function checkTofu () {
|
||||
setOutput('stderr', stderr.contents);
|
||||
setOutput('exitcode', exitCode.toString(10));
|
||||
|
||||
if (exitCode === 0 || exitCode === 2) {
|
||||
// A exitCode of 0 is considered a success
|
||||
// An exitCode of 2 may be returned when the '-detailed-exitcode' option
|
||||
// is passed to plan. This denotes Success with non-empty
|
||||
// diff (changes present).
|
||||
if (exitCode === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// A non-zero exitCode is considered an error
|
||||
// Any non-zero exitCode is treated as a failure, including exitCode 2 from
|
||||
// `plan -detailed-exitcode` (success with a non-empty diff). Previously 2 was
|
||||
// treated as success, but that hid the signal users opt into `-detailed-exitcode`
|
||||
// to receive.
|
||||
setFailed(`OpenTofu exited with code ${exitCode}.`);
|
||||
})();
|
||||
|
||||
+5
-6
@@ -44,14 +44,13 @@ async function checkTofu () {
|
||||
setOutput('stderr', stderr.contents);
|
||||
setOutput('exitcode', exitCode.toString(10));
|
||||
|
||||
if (exitCode === 0 || exitCode === 2) {
|
||||
// A exitCode of 0 is considered a success
|
||||
// An exitCode of 2 may be returned when the '-detailed-exitcode' option
|
||||
// is passed to plan. This denotes Success with non-empty
|
||||
// diff (changes present).
|
||||
if (exitCode === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// A non-zero exitCode is considered an error
|
||||
// Any non-zero exitCode is treated as a failure, including exitCode 2 from
|
||||
// `plan -detailed-exitcode` (success with a non-empty diff). Previously 2 was
|
||||
// treated as success, but that hid the signal users opt into `-detailed-exitcode`
|
||||
// to receive.
|
||||
setFailed(`OpenTofu exited with code ${exitCode}.`);
|
||||
})();
|
||||
Reference in new issue
Block a user