From dfd5afc609cd19c10efdff49eb909b54608a46da Mon Sep 17 00:00:00 2001 From: Luke Hsiao Date: Tue, 1 Aug 2023 18:59:29 -0700 Subject: [PATCH] fix: include lightweight tags in check Many repositories use lightweight (non-annotated) tags. This patch eliminates the scary warning that no tags were found, even if there were tags available. This makes the script match the behavior of `cog` itself (i.e., git describe --tags --abbrev=0) [[1]]. [1]: https://github.com/cocogitto/cocogitto/blob/main/src/git/revspec.rs#L347-L357 Closes: #11 Signed-off-by: Luke Hsiao --- cog.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cog.sh b/cog.sh index b036036..ea878c4 100755 --- a/cog.sh +++ b/cog.sh @@ -17,8 +17,8 @@ git config --global user.email "$GIT_USER_EMAIL" if [ "$CHECK" = "true" ]; then if [ "$LATEST_TAG_ONLY" = "true" ]; then - if [ "$(git describe --abbrev=0)" ]; then - message="Checking commits from $(git describe --abbrev=0)" + if [ "$(git describe --tags --abbrev=0)" ]; then + message="Checking commits from $(git describe --tags --abbrev=0)" else message="No tag found checking history from first commit" fi