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

Update diff-sha.sh

This commit is contained in:
Tonye Jack 2022-11-03 06:34:25 -06:00 committed by GitHub
parent 75a97e3f7b
commit 420c851349
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,6 +82,8 @@ 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
@ -132,7 +134,7 @@ else
CURRENT_BRANCH=$GITHUB_HEAD_REF
if [[ -z $INPUT_BASE_SHA ]]; then
git fetch --no-tags -u --progress --depth=10 origin "$TARGET_BRANCH":"$TARGET_BRANCH"
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
@ -140,7 +142,7 @@ else
fi
echo "::debug::Previous SHA: $PREVIOUS_SHA"
else
git fetch --no-tags -u --progress --depth=10 origin "$INPUT_BASE_SHA" && exit_status=$? || exit_status=$?
git fetch --no-tags -u --progress --depth="INPUT_FETCH_DEPTH" origin "$INPUT_BASE_SHA" && exit_status=$? || exit_status=$?
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
fi