From 3e7f8e79c00a0fad38ef59c0216695b4924a6500 Mon Sep 17 00:00:00 2001 From: Pavel Sklenar Date: Wed, 31 Jul 2024 07:29:10 +0200 Subject: [PATCH] chore: Update resolveMode function to handle commitMode --- src/utils.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 56b8de38..e3c98847 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -118,20 +118,19 @@ export function checkExportedData(exportCache: boolean, cacheInput: string | nul } export function resolveMode(mode: string | undefined, commitMode: boolean): 'PR' | 'COMMIT' | 'HYBRID' { - if (commitMode === false || mode === undefined) { - if (commitMode === true) { - return 'COMMIT' - } else { - return 'PR' - } - } else { - const upperCaseMode = mode.toUpperCase() + if (commitMode === true) { + return 'COMMIT' + } + + if (mode !== undefined) { + const upperCaseMode = mode.toUpperCase(); if (upperCaseMode === 'COMMIT') { return 'COMMIT' } else if (upperCaseMode === 'HYBRID') { return 'HYBRID' } } + return 'PR' }