fix exitcode bug when exitcode is 2

This commit is contained in:
dmsolutionsmn 2024-08-07 01:14:30 -05:00
parent 608d624bdf
commit ec7f248c65
2 changed files with 4 additions and 2 deletions

View file

@ -43,7 +43,8 @@ async function checkTerraform () {
core.setOutput('stderr', stderr.contents);
core.setOutput('exitcode', exitCode.toString(10));
if (exitCode === 0 || exitCode === 2) {
const usingDetailedExitcode = args.filter(arg => arg.toLowerCase().endsWith('-detailed-exitcode')).length > 0;
if (exitCode === 0 || (exitCode === 2 && usingDetailedExitcode)) {
// 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