From e11c6b4fe2e331129a76029882308d2d28c45d18 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 27 Oct 2021 19:59:37 -0400 Subject: [PATCH] Revert "Update base_sha to use the last commit on the current branch for push event (#235)" (#237) This reverts commit d924fccc1ee889a86e146ecf94dff68652cec972. --- entrypoint.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 8f96f1cf..60fbc71d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -44,14 +44,13 @@ if [[ $exit_status -ne 0 ]]; then fi if [[ -z $GITHUB_BASE_REF ]]; then - TARGET_BRANCH=${GITHUB_REF/refs\/heads\//} - CURRENT_BRANCH=$TARGET_BRANCH - if [[ -z $INPUT_BASE_SHA ]]; then - PREVIOUS_SHA=$(git rev-parse "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? + PREVIOUS_SHA=$(git rev-parse HEAD^1 2>&1) && exit_status=$? || exit_status=$? else PREVIOUS_SHA=$INPUT_BASE_SHA fi + TARGET_BRANCH=${GITHUB_REF/refs\/heads\//} + CURRENT_BRANCH=$TARGET_BRANCH if [[ $exit_status -ne 0 ]]; then echo "::warning::Unable to determine the previous commit sha"