Merge pull request #877 from tj-actions/fix/bug-using-since_last_remote_commit-with-force-push

fix: bug using since_last_remote_commit with force push
This commit is contained in:
Tonye Jack
2022-12-16 13:03:11 -07:00
committed by GitHub

View File

@@ -223,6 +223,10 @@ else
if [[ -z $INPUT_BASE_SHA ]]; then
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
if ! git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1; then
PREVIOUS_SHA=$(git rev-parse origin/"$CURRENT_BRANCH")
fi
else
PREVIOUS_SHA=${COMMON_ANCESTOR:-}