cocogitto / cocogitto-action

A github action to ensure your current gitlog respect the conventional commit specification
22 stars 17 forks source link

[BUG] this gives a false warning of only looking at annotated tags #11

Closed lukehsiao closed 1 year ago

lukehsiao commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

For a repository which only uses lightweight tags, not annotated tags, this action will show something similar to

Run /home/runner/work/_actions/oknozor/cocogitto-action/v3/cog.sh    \
  /home/runner/work/_actions/oknozor/cocogitto-action/v3/cog.sh    \
  true \
  true \
  false               \
  cog-bot              \
  cog@demo.org
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
Setting git user : cog-bot
Settings git user email cog@demo.org
fatal: No annotated tags can describe 'f907aa4ebb0dd07a557ed5dcba'.

The cause of this is the cog.sh script.

https://github.com/cocogitto/cocogitto-action/blob/ac6260150ee57e3164cd95b47fc84cdee9e3444c/cog.sh#L20-L25

Based on looking at the script, I actually suspect cog's actual check is still doing the right thing, it's just this red herring error message that might confuse a user.

To Reproduce Steps to reproduce the behavior:

In a repository with no annotated tags:

❯ git describe --abbrev=0
fatal: No annotated tags can describe 'f907aa4ebb0dd07a557ed5dcba34b39e3a11f43b'.
However, there were unannotated tags: try --tags.

❯ git describe --abbrev=0 --tags
v1.184.0

Expected behavior A clear and concise description of what you expected to happen.

It should check from the latest tag, whether that is annotated or not.

Additional context Add any other context about the problem here.

Djaytan commented 10 months ago

Hello @oknozor,

Is it possible to create a new tag for this version? The current latest tag (i.e. v3.5) doesn't include this change. I had trouble because of that.

For now I succeed to retrieve the right version with the following:

uses: cocogitto/cocogitto-action@1f7463bd27d1c999663b1d247791cb43c758c29a # non-published version

Thanks a lot!