fix: bug returning empty output for pull request close event (#1556)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2023-09-08 21:02:46 -06:00
committed by GitHub
parent fe0fb71961
commit 246636f5fa
3 changed files with 23 additions and 14 deletions

View File

@@ -465,13 +465,17 @@ export const getSHAForPullRequestEvent = async (
}
}
} else {
previousSha = await getRemoteBranchHeadSha({
cwd: workingDirectory,
branch: targetBranch
})
if (!previousSha) {
if (github.context.payload.action === 'closed') {
previousSha = github.context.payload.pull_request?.base?.sha
} else {
previousSha = await getRemoteBranchHeadSha({
cwd: workingDirectory,
branch: targetBranch
})
if (!previousSha) {
previousSha = github.context.payload.pull_request?.base?.sha
}
}
if (isShallow) {