chore: update check (#1555)
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
parent
523e8b6f11
commit
81bb5d8954
17
dist/index.js
generated
vendored
17
dist/index.js
generated
vendored
@ -1114,11 +1114,22 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
|||||||
if (github.context.payload.action &&
|
if (github.context.payload.action &&
|
||||||
github.context.payload.action === 'synchronize' &&
|
github.context.payload.action === 'synchronize' &&
|
||||||
previousSha &&
|
previousSha &&
|
||||||
(yield (0, utils_1.verifyCommitSha)({ sha: previousSha, cwd: workingDirectory })) !==
|
(!previousSha ||
|
||||||
0) {
|
(previousSha &&
|
||||||
|
(yield (0, utils_1.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');
|
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 &&
|
||||||
|
(yield (0, utils_1.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');
|
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -437,15 +437,28 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
github.context.payload.action &&
|
github.context.payload.action &&
|
||||||
github.context.payload.action === 'synchronize' &&
|
github.context.payload.action === 'synchronize' &&
|
||||||
previousSha &&
|
previousSha &&
|
||||||
(await verifyCommitSha({sha: previousSha, cwd: workingDirectory})) !==
|
(!previousSha ||
|
||||||
0
|
(previousSha &&
|
||||||
|
(await verifyCommitSha({
|
||||||
|
sha: previousSha,
|
||||||
|
cwd: workingDirectory,
|
||||||
|
showAsErrorMessage: false
|
||||||
|
})) !== 0))
|
||||||
) {
|
) {
|
||||||
throw new Error(
|
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'
|
'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(
|
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'
|
'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'
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user