Skip to content

Commit

Permalink
Merge pull request #1351 from pajikos/fix/commitMode-fix
Browse files Browse the repository at this point in the history
COMMIT mode not returned when commitMode is true
  • Loading branch information
mikepenz authored Aug 2, 2024
2 parents 92bd1e6 + 3e7f8e7 commit 13f7fbe
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down

0 comments on commit 13f7fbe

Please sign in to comment.