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

fix: bug omitting the fetch-depth for push based events (#434)

This commit is contained in:
Tonye Jack 2022-03-16 01:32:30 -04:00 committed by GitHub
parent 9125e4d5da
commit 1f30bd2085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,10 +52,13 @@ if [[ -z $GITHUB_BASE_REF ]]; then
CURRENT_BRANCH=$TARGET_BRANCH CURRENT_BRANCH=$TARGET_BRANCH
if [[ -z $INPUT_BASE_SHA ]]; then if [[ -z $INPUT_BASE_SHA ]]; then
git fetch --no-tags -u --progress --depth=2 temp_changed_files "${CURRENT_BRANCH}":"${CURRENT_BRANCH}" && exit_status=$? || exit_status=$?
if [[ $(git rev-list --count HEAD) -gt 1 ]]; then if [[ $(git rev-list --count HEAD) -gt 1 ]]; then
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 HEAD^1 2>&1) && exit_status=$? || exit_status=$? PREVIOUS_SHA=$(git rev-list --no-merges -n 1 HEAD^1 2>&1) && exit_status=$? || exit_status=$?
else else
PREVIOUS_SHA=$CURRENT_SHA PREVIOUS_SHA=$CURRENT_SHA
echo "Initial commit detected"
fi fi
else else
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$? PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?