Skip to content

Commit 714f2ef

Browse files
fix: fix shallow clones not retrieving a valid semver (#13609)
1 parent 73a25c3 commit 714f2ef

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/version.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ if [[ -n "${CODER_FORCE_VERSION:-}" ]]; then
2626
exit 0
2727
fi
2828

29-
# To make contributing easier, if the upstream isn't coder/coder and there are
30-
# no tags we will fall back to 0.1.0 with devel suffix.
31-
remote_url=$(git remote get-url origin)
29+
# To make contributing easier, if there are no tags, we'll use a default
30+
# version.
3231
tag_list=$(git tag)
33-
if ! [[ ${remote_url} =~ [@/]github.com ]] && ! [[ ${remote_url} =~ [:/]coder/coder(\.git)?$ ]] && [[ -z ${tag_list} ]]; then
32+
if [[ -z ${tag_list} ]]; then
3433
log
35-
log "INFO(version.sh): It appears you've checked out a fork of Coder."
34+
log "INFO(version.sh): It appears you've checked out a fork or shallow clone of Coder."
3635
log "INFO(version.sh): By default GitHub does not include tags when forking."
3736
log "INFO(version.sh): We will use the default version 2.0.0 for this build."
3837
log "INFO(version.sh): To pull tags from upstream, use the following commands:"

0 commit comments

Comments
 (0)