chore: update check (#1555)
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
@@ -437,15 +437,28 @@ export const getSHAForPullRequestEvent = async (
|
||||
github.context.payload.action &&
|
||||
github.context.payload.action === 'synchronize' &&
|
||||
previousSha &&
|
||||
(await verifyCommitSha({sha: previousSha, cwd: workingDirectory})) !==
|
||||
0
|
||||
(!previousSha ||
|
||||
(previousSha &&
|
||||
(await verifyCommitSha({
|
||||
sha: previousSha,
|
||||
cwd: workingDirectory,
|
||||
showAsErrorMessage: false
|
||||
})) !== 0))
|
||||
) {
|
||||
throw new Error(
|
||||
'Unable to locate the previous commit in the local history. Please ensure to checkout pull request HEAD commit instead of the merge commit. See: https://github.com/actions/checkout/blob/main/README.md#checkout-pull-request-head-commit-instead-of-merge-commit'
|
||||
)
|
||||
}
|
||||
|
||||
if (!previousSha) {
|
||||
if (
|
||||
!previousSha ||
|
||||
(previousSha &&
|
||||
(await verifyCommitSha({
|
||||
sha: previousSha,
|
||||
cwd: workingDirectory,
|
||||
showAsErrorMessage: false
|
||||
})) !== 0)
|
||||
) {
|
||||
throw new Error(
|
||||
'Unable to locate the previous commit in the local history. Please ensure to checkout pull request HEAD commit instead of the merge commit. See: https://github.com/actions/checkout/blob/main/README.md#checkout-pull-request-head-commit-instead-of-merge-commit'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user