Apply suggestions from code review

Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com>
This commit is contained in:
Tonye Jack 2023-05-22 21:45:51 -06:00 committed by GitHub
parent d0e721c7e1
commit 6d62f72b7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,7 @@ const getCurrentSHA = async ({
}) })
} catch (error) { } catch (error) {
core.error( core.error(
'Invalid until date: ' + inputs.until + '. ' + (error as Error).message `Invalid until date: ${ inputs.until }. ${ (error as Error).message}`
) )
throw error throw error
} }
@ -76,12 +76,12 @@ export const getSHAForPushEvent = async (
isTag: boolean isTag: boolean
): Promise<SHAResult> => { ): Promise<SHAResult> => {
let targetBranch = env.GITHUB_REFNAME let targetBranch = env.GITHUB_REFNAME
let currentBranch = targetBranch const currentBranch = targetBranch
let initialCommit = false let initialCommit = false
let currentSha = inputs.sha let currentSha = inputs.sha
let previousSha = inputs.baseSha let previousSha = inputs.baseSha
let diff = '..' const diff = '..'
if (isShallow) { if (isShallow) {
core.info('Repository is shallow, fetching more history...') core.info('Repository is shallow, fetching more history...')
@ -163,10 +163,10 @@ export const getSHAForPushEvent = async (
}) })
} catch (error) { } catch (error) {
core.error( core.error(
'Invalid since date: ' + `Invalid since date: ${
inputs.since + inputs.since
'. ' + }. ${
(error as Error).message (error as Error).message}`
) )
throw error throw error
} }
@ -247,7 +247,7 @@ export const getSHAForPullRequestEvent = async (
gitExtraArgs: string[] gitExtraArgs: string[]
): Promise<SHAResult> => { ): Promise<SHAResult> => {
let targetBranch = env.GITHUB_EVENT_PULL_REQUEST_BASE_REF let targetBranch = env.GITHUB_EVENT_PULL_REQUEST_BASE_REF
let currentBranch = env.GITHUB_EVENT_PULL_REQUEST_HEAD_REF const currentBranch = env.GITHUB_EVENT_PULL_REQUEST_HEAD_REF
let currentSha = inputs.sha let currentSha = inputs.sha
let previousSha = inputs.baseSha let previousSha = inputs.baseSha
let diff = '...' let diff = '...'