diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1dafef2b75a..1d6e5083305 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,6 @@ on: - "**" pull_request: types: - - closed - opened - synchronize - reopened diff --git a/diff-sha.sh b/diff-sha.sh index f825c0465ae..efe250978f0 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -194,12 +194,10 @@ else if [[ -z $INPUT_BASE_SHA ]]; then if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then - echo "::debug::Fetching remote current branch..." - 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") + PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA fi else echo "::debug::Fetching remote target branch..."