From 6d62f72b7ed42481ff7075735effa72a6027ba29 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 22 May 2023 21:45:51 -0600 Subject: [PATCH] Apply suggestions from code review Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com> --- src/commitSha.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/commitSha.ts b/src/commitSha.ts index 003c37c9..695822db 100644 --- a/src/commitSha.ts +++ b/src/commitSha.ts @@ -42,7 +42,7 @@ const getCurrentSHA = async ({ }) } catch (error) { core.error( - 'Invalid until date: ' + inputs.until + '. ' + (error as Error).message + `Invalid until date: ${ inputs.until }. ${ (error as Error).message}` ) throw error } @@ -76,12 +76,12 @@ export const getSHAForPushEvent = async ( isTag: boolean ): Promise => { let targetBranch = env.GITHUB_REFNAME - let currentBranch = targetBranch + const currentBranch = targetBranch let initialCommit = false let currentSha = inputs.sha let previousSha = inputs.baseSha - let diff = '..' + const diff = '..' if (isShallow) { core.info('Repository is shallow, fetching more history...') @@ -163,10 +163,10 @@ export const getSHAForPushEvent = async ( }) } catch (error) { core.error( - 'Invalid since date: ' + - inputs.since + - '. ' + - (error as Error).message + `Invalid since date: ${ + inputs.since + }. ${ + (error as Error).message}` ) throw error } @@ -247,7 +247,7 @@ export const getSHAForPullRequestEvent = async ( gitExtraArgs: string[] ): Promise => { 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 previousSha = inputs.baseSha let diff = '...'