Skip to content

Commit

Permalink
Suppress 'git fetch --unshallow' error (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
micnncim authored Sep 18, 2020
1 parent 4c70a61 commit 2ddc5e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
set -e

git fetch --tags
git fetch --prune --unshallow
# This suppress an error occurred when the repository is a complete one.
git fetch --prune --unshallow || true

latest_tag=''

Expand All @@ -13,7 +14,7 @@ if [ "${INPUT_SEMVER_ONLY}" = 'false' ]; then
else
# Get a latest tag in the shape of semver.
for ref in $(git for-each-ref --sort=-creatordate --format '%(refname)' refs/tags); do
tag="${ref#refs/tags/}"
readonly tag="${ref#refs/tags/}"
if echo "${tag}" | grep -Eq '^v?([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$'; then
latest_tag="${tag}"
break
Expand Down

0 comments on commit 2ddc5e7

Please sign in to comment.