Skip to content

Conversation

@timothyclarke
Copy link
Contributor

@timothyclarke timothyclarke commented Sep 16, 2024

Summary of changes

Added TAG_PREFIX to replace WITH_V. WITH_V is still in place for backwards comparability, but the idea is it would be removed in a few versions (gives people a chance to change their code, doesn't force a major etc)

This should fix #320. I have a similar use case where a monorepo has a bunch of folders which maintain independent versions

This is best used along side changed-files and a matrix

Breaking Changes

Do any of the included changes break current behaviour or configuration?

NO : The changes are backwards compatible to allow a smoother transition

How changes have been tested

Backwards compatibility
tagging WITH_V false
tagging WITH_V true

New Feature (all in matrix jobs as that's my usecase)
Bump multiple tags
Bump one tag add one tag

List any unknowns

@timothyclarke timothyclarke marked this pull request as ready for review September 17, 2024 09:44
@timothyclarke timothyclarke changed the title Added TAG_PREFIX Added TAG_PREFIX so more descriptive tags can be used Sep 17, 2024
@timothyclarke
Copy link
Contributor Author

@anothrNick When you get a chance can you take a look at this one please

@yannickpoggel
Copy link

Hi @anothrNick , this feature would be great for working with monorepos.

README.md Outdated
- **DEFAULT_BUMP** _(optional)_ - Which type of bump to use when none explicitly provided (default: `minor`).
- **DEFAULT_BRANCH** _(optional)_ - Overwrite the default branch its read from GitHub Runner env var but can be overwritten (default: `$GITHUB_BASE_REF`). Strongly recommended to set this var if using anything else than master or main as default branch otherwise in combination with history full will error.
- **WITH_V** _(optional)_ - Tag version with `v` character.
- **WITH_V** _(optional, depricated)_ - Tag version with `v` character. Replaced by TAG_PREFIX

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **WITH_V** _(optional, depricated)_ - Tag version with `v` character. Replaced by TAG_PREFIX
- **WITH_V** _(optional, deprecated)_ - Tag version with `v` character. Replaced by TAG_PREFIX

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robw-raviga Thanks. Fixed in ed6507f

@dethell
Copy link

dethell commented Mar 5, 2025

Any chance this can get merged? It's the only thing holding our team up from using this in our monorepo.

@anothrNick
Copy link
Owner

@timothyclarke @yannickpoggel @dethell Approved. I will merge and deploy.

@anothrNick anothrNick merged commit da70c4e into anothrNick:master May 7, 2025
@anothrNick
Copy link
Owner

Should be available in 1.72.0

@rorybartie
Copy link
Contributor

@anothrNick and @timothyclarke It seems like this PR is causing 2 v's to be prefixed to the tag if you are still using the WITH_V: true tag in your workflows. The tag ends up looking something like this vv0.2.0-dev.0. This in turn then causes the next run of the action to fail because it tries to create the same tag again.
Here is an example output from the failing action:

Setting dev pre-tag v2.19.1-dev.0 - With pre-tag vv2.20.0-dev.0
EVENT: creating local tag vv2.20.0-dev.0
Updated tag 'vv2.20.0-dev.0' (was 98cfac70)
EVENT: pushing tag vv2.20.0-dev.0 to origin
2025-05-09T09:04:15Z: **pushing tag vv2.20.0-dev.0 to repo repo_name
  "message": "Reference already exists",
  "documentation_url": "https://docs.github.com/rest/git/refs#create-a-reference",
  "status": "422"
}

In this case the tag vv2.20.0-dev.0 was already created in a previous run.

else
new="$new-$suffix.0"
fi
new="${tagPrefix}${new}-${suffix}.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the bug comes in. ${new} already has the tag prefix.

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

Successfully merging this pull request may close these issues.

Feature Request: Prefixes

7 participants