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

Gets absolute latest tag, not just latest tag on branch #16

Open
Prospector opened this issue Jan 23, 2021 · 7 comments
Open

Gets absolute latest tag, not just latest tag on branch #16

Prospector opened this issue Jan 23, 2021 · 7 comments
Milestone

Comments

@Prospector
Copy link

Prospector commented Jan 23, 2021

I'm not sure if this is intentional or not, but the action seems to get the latest tag across all branches, instead of just the latest on the branch that I run a workflow on.

The way I use the action is I have a manually triggered workflow_dispatch workflow that I can run on any branch. When I want to push a release, I trigger a workflow, and use your action in order to get the previous version number, so I can bump it. However, let's say I have two branches: 1.15 and 1.16, and the latest tag on the 1.15 branch is v1.10.4 and the latest tag on the 1.16 branch is v1.14.3, if I trigger my workflow on the 1.15 branch, your action gets the latest tag, which is v1.14.3, even though that's on a separate branch. Because of this, I'm unable to push a release for an older branch.

I'm not too sure about how git tags work, but I figure it should probably be possible to only get tags based on a certain branch? Hoping this isn't a difficult issue.

@WyriHaximus
Copy link
Owner

This isn't intentional, is the repository public so I can have a look? And which checkout version are you using?

@Prospector
Copy link
Author

Prospector commented Jan 25, 2021

Using actions/checkout@v2

So here you can see that checkout is using the branch 1.15:
image

And then here, get-previous-tag finds that the latest tag is v1.14.13 :
image

However, this should be the latest tag on the 1.15 branch https://github.com/TerraformersMC/ModMenu/releases/tag/v1.10.4

Workflow is here: https://github.com/TerraformersMC/ModMenu/blob/1.16/.github/workflows/release_patch.yml#L19
You can check here that all of the tags since have been on the 1.16 branch https://github.com/TerraformersMC/ModMenu/tags

There's probably a decent chance it's something I did wrong, but if so I can't see what it is right now

@RicardoMonteiroSimoes
Copy link

I think the issue is that the GitHub action in Marketplace hasn't been updated? I'm not sure but I was under the impression that last release is ahead of the usable action, because I'm having the same problem.

@WyriHaximus
Copy link
Owner

@RicardoMonteiroSimoes Thanks for reporting, just made sure the latest release is on the marketplace.

@RicardoMonteiroSimoes
Copy link

Thanks a lot, it works for me now :)

@deepankarm
Copy link

Is there a way to achieve the opposite of what the OP asked?

Gets absolute latest tag, not just latest tag on branch?

@StephenCleary
Copy link

I'm also seeing the op's original issue on my Disposables repo. I normally push changes from master, but also have a reorg branch with a pre-release v3 tag. When running your action on the master branch, it finds the prerelease tag from the reorg branch instead of the latest release on the master branch.

@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

5 participants