Skip to content

Commit 1f30bd2

Browse files
authored
fix: bug omitting the fetch-depth for push based events (#434)
1 parent 9125e4d commit 1f30bd2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

diff-sha.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ if [[ -z $GITHUB_BASE_REF ]]; then
5252
CURRENT_BRANCH=$TARGET_BRANCH
5353

5454
if [[ -z $INPUT_BASE_SHA ]]; then
55+
git fetch --no-tags -u --progress --depth=2 temp_changed_files "${CURRENT_BRANCH}":"${CURRENT_BRANCH}" && exit_status=$? || exit_status=$?
56+
5557
if [[ $(git rev-list --count HEAD) -gt 1 ]]; then
5658
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 HEAD^1 2>&1) && exit_status=$? || exit_status=$?
5759
else
5860
PREVIOUS_SHA=$CURRENT_SHA
61+
echo "Initial commit detected"
5962
fi
6063
else
6164
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?

0 commit comments

Comments
 (0)