fix: raise errors when unable to locate the previous commit in local history (#1551)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2023-09-08 12:31:25 -06:00
committed by GitHub
parent 534262e0b2
commit 796ac2d08f
4 changed files with 71 additions and 31 deletions

View File

@@ -426,8 +426,8 @@ export const getSHAForPullRequestEvent = async (
github.context.payload.action &&
github.context.payload.action === 'synchronize'
) {
core.warning(
'Unable to locate the remote branch head sha. Falling back to the previous commit in the local history.'
throw 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)'
)
} else {
core.info(