From 7c7232040403e5ad44fb31057f9b7efe9dd43ace Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 Jun 2023 21:46:30 -0600 Subject: [PATCH] chore(deps): lock file maintenance (#1224) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tonye Jack Co-authored-by: GitHub Action --- dist/index.js | Bin 317891 -> 318187 bytes dist/index.js.map | Bin 373406 -> 373726 bytes src/commitSha.ts | 6 +++++- src/env.ts | 3 +++ src/utils.ts | 6 +++--- yarn.lock | 6 +++--- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/dist/index.js b/dist/index.js index d07621240df2783b20684be4e151fc3821c14ab8..10dca74db499c0435dbcfa7536f631e6feb75775 100644 GIT binary patch delta 178 zcmX@SS@`u<;SE=vnQ~Gmf7Hy`?CMg+Gx=|jI$LQ`QEFbvWPc;^$?Fn%IXzq*UE+g1 z9IZF62{_C%x!}IY=IYoqR*;+sOwLL{LnA&%!B#;dK6|o%lE!51N75`Asfj6*eI99T zK9IDpnoT1oGcQ$hbJIOv&glVP7)2)Unjo?H=ks~2Y#Ifc3buBWYhPnK0MBdHvFXyo`7BnAt*M8s~BM>ufKk$xO`wajnpe8f` diff --git a/dist/index.js.map b/dist/index.js.map index 6add48391239da1cf2b584a54948c7d4c67f95b4..19ff245691684ebb65bde22defa96ad62905879c 100644 GIT binary patch delta 242 zcmbRDRP5e!u?@mp69f1sE5vg#=|^l9V}q0#gV8 delta 161 zcmccjTx{M`u?@mplQyukT01(MMr?k#$%>H$$TV**F2I63QTX=!>BOLlbLT3;+NC diff --git a/src/commitSha.ts b/src/commitSha.ts index 7999f166..d0d6847b 100644 --- a/src/commitSha.ts +++ b/src/commitSha.ts @@ -321,7 +321,7 @@ export const getSHAForPullRequestEvent = async ( core.info('Completed fetching more history.') } - const currentSha = await getCurrentSHA({inputs, workingDirectory}) + let currentSha = await getCurrentSHA({inputs, workingDirectory}) let previousSha = inputs.baseSha let diff = '...' @@ -425,6 +425,10 @@ export const getSHAForPullRequestEvent = async ( } } + if (previousSha === currentSha && env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA) { + currentSha = env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA + } + if ( !(await canDiffCommits({ cwd: workingDirectory, diff --git a/src/env.ts b/src/env.ts index ddb8dbdf..56fe7d80 100644 --- a/src/env.ts +++ b/src/env.ts @@ -14,6 +14,7 @@ export type Env = { GITHUB_EVENT_FORCED: string GITHUB_EVENT_PULL_REQUEST_NUMBER: string GITHUB_EVENT_PULL_REQUEST_BASE_SHA: string + GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: string } type GithubEvent = { @@ -21,6 +22,7 @@ type GithubEvent = { pull_request?: { head: { ref: string + sha: string } base: { ref: string @@ -58,6 +60,7 @@ export const getEnv = async (): Promise => { GITHUB_EVENT_HEAD_REPO_FORK: eventJson.head_repo?.fork || '', GITHUB_EVENT_PULL_REQUEST_NUMBER: eventJson.pull_request?.number || '', GITHUB_EVENT_PULL_REQUEST_BASE_SHA: eventJson.pull_request?.base?.sha || '', + GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: eventJson.pull_request?.head?.sha || '', GITHUB_EVENT_FORCED: eventJson.forced || '', GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '', GITHUB_REF: process.env.GITHUB_REF || '', diff --git a/src/utils.ts b/src/utils.ts index 1d58ac05..73ef5996 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -288,7 +288,7 @@ export const getSubmodulePath = async ({ return stdout .trim() .split('\n') - .map(line => normalizePath(line.split(' ')[1])) + .map((line: string) => normalizePath(line.split(' ')[1])) } export const gitSubmoduleDiffSHA = async ({ @@ -389,7 +389,7 @@ export const gitRenamedFiles = async ({ .trim() .split('\n') .filter(Boolean) - .map(line => { + .map((line: string) => { core.debug(`Renamed file: ${line}`) const [, oldPath, newPath] = line.split('\t') if (isSubmodule) { @@ -459,7 +459,7 @@ export const gitDiff = async ({ const files = stdout .split('\n') .filter(Boolean) - .map(p => { + .map((p: string) => { if (isSubmodule) { return normalizePath(path.join(parentDir, p)) } diff --git a/yarn.lock b/yarn.lock index 4abc92af..63dde4f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1171,9 +1171,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001489: - version "1.0.30001492" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001492.tgz#4a06861788a52b4c81fd3344573b68cc87fe062b" - integrity sha512-2efF8SAZwgAX1FJr87KWhvuJxnGJKOnctQa8xLOskAXNXq8oiuqgl6u1kk3fFpsp3GgvzlRjiK1sl63hNtFADw== + version "1.0.30001494" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001494.tgz#3e56e04a48da7a79eae994559eb1ec02aaac862f" + integrity sha512-sY2B5Qyl46ZzfYDegrl8GBCzdawSLT4ThM9b9F+aDYUrAG2zCOyMbd2Tq34mS1g4ZKBfjRlzOohQMxx28x6wJg== chalk@^2.0.0: version "2.4.2"