3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-17 03:47:20 +00:00

Updated diff-sha.sh

This commit is contained in:
Tonye Jack 2022-11-03 12:08:29 -06:00
parent a8965747f2
commit 62aef87f39

View file

@ -72,8 +72,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then
TARGET_BRANCH=${GITHUB_REF/refs\/heads\//} && exit_status=$? || exit_status=$?
CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$?
git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH"
if [[ -z $INPUT_BASE_SHA ]]; then
if [[ -n "$INPUT_SINCE" ]]; then
echo "::debug::Getting base SHA for '$INPUT_SINCE'..."
@ -84,6 +82,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then
exit 1
fi
else
git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH"
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
if [[ -z "$PREVIOUS_SHA" ]]; then
@ -112,6 +111,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then
fi
fi
else
git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH"
PREVIOUS_SHA=$INPUT_BASE_SHA
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
CURRENT_BRANCH=$TARGET_BRANCH