Skip to content

Commit bfb7244

Browse files
committed
Only use --unshallow for shallow repositories
1 parent 4f97986 commit bfb7244

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

merge

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ if [ -z "$GIT_AUTHOR_EMAIL" ]; then
2020
fi
2121
export GIT_COMMITTER_NAME=GitHub
2222
export GIT_COMMITTER_EMAIL=noreply@github.com
23-
git fetch --unshallow origin "$INPUT_BASE_REF" ||
23+
if [ "$(git rev-parse --is-shallow-repository)" = 'true' ]; then
24+
UNSHALLOW=--unshallow
25+
fi
26+
git fetch $UNSHALLOW origin "$INPUT_BASE_REF" ||
2427
report_failure "Can't get history for base_ref ($INPUT_BASE_REF). Please contact support for $GITHUB_ACTION_REPOSITORY"
2528
GITHUB_BASE_SHA=$(git rev-parse FETCH_HEAD)
2629

0 commit comments

Comments
 (0)