fix/resolve bug fetching more history (#1176)
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
@@ -137,7 +137,7 @@ export const getSHAForPushEvent = async (
|
||||
}
|
||||
|
||||
await verifyCommitSha({sha: previousSha, cwd: workingDirectory})
|
||||
core.info(`Previous SHA: ${previousSha}`)
|
||||
core.debug(`Previous SHA: ${previousSha}`)
|
||||
|
||||
return {
|
||||
previousSha,
|
||||
@@ -177,10 +177,6 @@ export const getSHAForPushEvent = async (
|
||||
core.debug('Getting previous SHA for last remote commit...')
|
||||
if (env.GITHUB_EVENT_FORCED === 'false' || !env.GITHUB_EVENT_FORCED) {
|
||||
previousSha = env.GITHUB_EVENT_BEFORE
|
||||
} else {
|
||||
previousSha = await getParentSha({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -190,6 +186,19 @@ export const getSHAForPushEvent = async (
|
||||
previousSha = await getParentSha({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
} else if (
|
||||
(await verifyCommitSha({
|
||||
sha: previousSha,
|
||||
cwd: workingDirectory,
|
||||
showAsErrorMessage: false
|
||||
})) !== 0
|
||||
) {
|
||||
core.warning(
|
||||
`Previous commit ${previousSha} is not valid. Using parent commit.`
|
||||
)
|
||||
previousSha = await getParentSha({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
}
|
||||
|
||||
if (previousSha === currentSha) {
|
||||
@@ -322,7 +331,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
}
|
||||
|
||||
await verifyCommitSha({sha: currentSha, cwd: workingDirectory})
|
||||
core.info(`Previous SHA: ${previousSha}`)
|
||||
core.debug(`Previous SHA: ${previousSha}`)
|
||||
|
||||
return {
|
||||
previousSha,
|
||||
|
||||
Reference in New Issue
Block a user