mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-16 19:27:39 +00:00
fix: bug omitting the fetch-depth for push based events (#434)
This commit is contained in:
parent
9125e4d5da
commit
1f30bd2085
1 changed files with 3 additions and 0 deletions
|
@ -52,10 +52,13 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||
CURRENT_BRANCH=$TARGET_BRANCH
|
||||
|
||||
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
|
||||
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 HEAD^1 2>&1) && exit_status=$? || exit_status=$?
|
||||
else
|
||||
PREVIOUS_SHA=$CURRENT_SHA
|
||||
echo "Initial commit detected"
|
||||
fi
|
||||
else
|
||||
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
|
||||
|
|
Loading…
Reference in a new issue