From 5cd49f8c2dd62a94af6c49e7f8a49669a06434b6 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 12 Oct 2022 13:23:59 -0600 Subject: [PATCH] Updated the log message --- diff-sha.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index 6c610cd8..82d7529d 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -103,8 +103,6 @@ else TARGET_BRANCH=$GITHUB_BASE_REF CURRENT_BRANCH=$GITHUB_HEAD_REF - echo "::debug::GITHUB_BASE_REF: $TARGET_BRANCH..." - git fetch --no-tags -u --progress origin --depth="$INPUT_TARGET_BRANCH_FETCH_DEPTH" "${TARGET_BRANCH}":"${TARGET_BRANCH}" && exit_status=$? || exit_status=$? @@ -112,12 +110,12 @@ else PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$? echo "::debug::Previous SHA: $PREVIOUS_SHA" else - PREVIOUS_SHA=$INPUT_BASE_SHA - TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$? - echo "::debug::Previous SHA: $PREVIOUS_SHA" - echo "::debug::Target branch: $TARGET_BRANCH" + PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$? fi + echo "::debug::Target branch: $TARGET_BRANCH" + echo "::debug::Current branch: $CURRENT_BRANCH" + echo "::debug::Verifying the previous commit SHA: $PREVIOUS_SHA" git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?