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

Allow for prefixed tags #18

Closed
orf opened this issue Jul 19, 2021 · 5 comments · Fixed by #62
Closed

Allow for prefixed tags #18

orf opened this issue Jul 19, 2021 · 5 comments · Fixed by #62

Comments

@orf
Copy link

orf commented Jul 19, 2021

When using cargo release with a Rust workspace (i.e one containing multiple projects) the tags are created as [proj-name]-[version]. For example: gping-v1.2.3.

This unfortunately causes this action to not work (see here), as it says Skipping: the formula version 'v1.2.1' is newer than 'gping-v1.2.3'.

Is there a way around this? Perhaps by supplying some kind of regex to extract the version and ignore the prefix?

@mislav
Copy link
Owner

mislav commented Aug 12, 2021

Thanks for reporting! I'm not sure how to fix this. Here is our version-related code: https://github.com/mislav/bump-homebrew-formula-action/blob/main/src/version.ts

Perhaps by supplying some kind of regex to extract the version and ignore the prefix?

That sounds like a plausible approach, but how to expose this while at the same time making it easy to use?

@nitrocode
Copy link

Maybe expose the regex as an input and retain its current value as the default? Would that work?

const RE = /([0-9]+)|([a-zA-Z]+)/g

@john-u
Copy link

john-u commented Jul 11, 2022

We ran into this issue as well and are unable to use it currently so I started a draft PR #38.

@john-u
Copy link

john-u commented Jul 12, 2022

Our issue (workflow run) is a little different but related as it is an issue with tag parsing and comparison.

Skipping: the formula is already at version '@smartthings'

@mislav
Copy link
Owner

mislav commented Sep 20, 2023

I've finally taken a long look into this, and the problem of prefixed tags doesn't seem so hard.

@john-u Thanks for reporting your case. In the scenario of smartthings download URLs, the version parser failed to account that your tag names might have the / character in them. This is now fixed.

@orf In the case of tag names such as gping-v1.2.3, this project should already work even though the version numbers are "prefixed". Our version comparison function doesn't care if the tag is prefixed or not; it will simply compare e.g. gping-v1.13.2 to gping-v1.14.0 and determine that the latter is the newer version. However, it will fail when comparing non-prefixed version numbers such as v.1.14 to gping-v1.13.0. Since your git tag names are always prefixed, I'm not sure how it happened in the first place that a non-prefixed version number was used in comparison. When this happens again, please post the YAML setup of the workflow that uses this action. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants