action-get-latest-tag icon indicating copy to clipboard operation
action-get-latest-tag copied to clipboard

Occasionally gives the wrong version

Open wdoug opened this issue 3 years ago • 5 comments

What happened

Sometimes this gives me the wrong version. I'm not sure why. For example, see the output of this workflow. The latest tag should be 2.9.0, but this action is repeatedly giving 2.8.1 as the latest (which was also created earlier).

Screen Shot 2021-03-03 at 9 23 46 PM

What you expected to happen

I expected that I would get the highest release for the repo by default.

How to reproduce it

I'm not sure

wdoug avatar Mar 04 '21 04:03 wdoug

Oh, hmm. I'm realizing that somehow I ended up tagging that same commit twice... Screen Shot 2021-03-03 at 9 37 08 PM

I would still have hoped this GitHub action would have gotten the latest SemVer tag

wdoug avatar Mar 04 '21 04:03 wdoug

Okay, this just happened again and this time the commits are definitely different. Screen Shot 2021-08-23 at 4 31 45 PM Screen Shot 2021-08-23 at 4 33 13 PM

Screen Shot 2021-08-23 at 4 34 34 PM Screen Shot 2021-08-23 at 4 34 41 PM

wdoug avatar Aug 23 '21 22:08 wdoug

Okay, for our purposes it looks like setting semver_only to true resolved that second issue.

wdoug avatar Aug 24 '21 14:08 wdoug

I had the same issue with the wrong tag being selected when multiple tags were on one commit, fixed it by running echo "::set-output name=a::$(git tag --sort=v:refname | tail -n 1)" instead of using this action. e.g.

- name: Get Lastest Tag
  id: get-latest-tag
  run: echo "::set-output name=tag::$(git tag --sort=v:refname | tail -n 1)"

Graicc avatar Nov 30 '21 22:11 Graicc

Same bug here. Latest tag was 1.2.5 but this action takes 1.2.3 which was made like months ago. I think it happens when you use actions from branches other than main.

Kuhpik avatar May 03 '22 22:05 Kuhpik