Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action pulls tag associated with latest commit, not the latest tag #31

Open
bakoontz2 opened this issue Sep 5, 2022 · 1 comment
Open
Milestone

Comments

@bakoontz2
Copy link
Contributor

bakoontz2 commented Sep 5, 2022

(Sorry, the workflow is not accessible publicly)

Two tags of interest, 1.10.109 and 1.10.110. Pulling the timestamps for the associated commits:

image

The timestamps for the tags themselves:

image

Clearly, 1.10.110 was created at a later time than 1.10.109. However, this is what get-previous-tag returns:

image

Interestingly, the timestamp "1662046975" corresponds to the commit time shown in the first image:

image

In the code:

image

"rev-list" "lists commit objects in reverse chronological order" (per the git-rev-list manpage). So the revision that is being returned isn't the revision associated with the latest tag, it's the revision representing the latest commit.

A more accurate command to actually return the lastest tag might be:

git for-each-ref --sort=-taggerdate --format="%(refname:short) | %(taggerdate)" "refs/tags/*"

where the last returned value is, in fact, the latest tag:

image

@bakoontz2 bakoontz2 changed the title Action pulls latest commit associated with tag, not the latest tag Action pulls tag associated with latest commit, not the latest tag Sep 5, 2022
@WyriHaximus
Copy link
Owner

(Sorry, the workflow is not accessible publicly)

No worries, it's normally useful for easier debugging. But you've made an outstanding case with examples all the way down. The code changes in the PR look good, but for some reason don't output a commit. Will see how they can be updated to fail when that is missing.

@WyriHaximus WyriHaximus added this to the v1.5.0 milestone Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants