Skip to content

Commit

Permalink
fix: bug omitting the fetch-depth for push based events (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Mar 16, 2022
1 parent 9125e4d commit 1f30bd2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions diff-sha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$?
Expand Down

0 comments on commit 1f30bd2

Please sign in to comment.