fix: bug with retrieving the base sha when since last commit is enabled (#1213)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack 2023-06-01 11:18:54 -06:00 committed by GitHub
parent 72cf8893fc
commit 9ecc6e7fe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 21 deletions

11
dist/index.js generated vendored
View File

@ -436,16 +436,9 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
if (inputs.sinceLastRemoteCommit) {
previousSha = env.GITHUB_EVENT_BEFORE;
if (!previousSha) {
previousSha = yield (0, utils_1.getRemoteBranchHeadSha)({
cwd: workingDirectory,
branch: currentBranch
});
previousSha = yield (0, utils_1.getParentSha)({ cwd: workingDirectory });
}
if ((yield (0, utils_1.verifyCommitSha)({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0) {
if (!previousSha) {
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA;
}
}

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -360,19 +360,10 @@ export const getSHAForPullRequestEvent = async (
previousSha = env.GITHUB_EVENT_BEFORE
if (!previousSha) {
previousSha = await getRemoteBranchHeadSha({
cwd: workingDirectory,
branch: currentBranch
})
previousSha = await getParentSha({cwd: workingDirectory})
}
if (
(await verifyCommitSha({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0
) {
if (!previousSha) {
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
}
} else {