fix: drop the success behavior for -detailed-exitcode==2

Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
This commit is contained in:
Diogenes Fernandes committed 2026-04-15 19:40:12 -03:00
1 parent 4bcfe8cded
commit 0fbe4daab2
2 files changed
+10 -12

No files matched your search

+5 -6
View File
@@ -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
View File
@@ -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}.`);
})();