Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

make tag creation optional #730

Answered by woile
TheKangaroo asked this question in Q&A
Discussion options

Description

It would be great for our workflow to make it possible to opt out via config option of the creation of a git tag on cz bump.

Possible Solution

we could add a config option like disable_tag_creation (which defaults to false) to make it possible to optional disable the creation of the git tag.

Additional context

We just started to use commitizen so maybe our workflow isn't the best right now.

Our GitLab rules forbid to push on main and we don't want to change that. So we needed to find a way to create releases with commitizen without pushing to main. We came up with the following workflow:

  • create new branch localy from main
  • run cz bump (with changelog creation) (which create a local tag on that feature branch)
  • push a merge request (just the commit without the tag) to the upstream repo
  • have a teammate review and approve the merge request
  • merge the merge request
  • a ci pipeline will run on every merge to master with commit message "bump: version.*" and create a gitlab release for it which also creates a git tag

But this means we end up with tags on different commits locally than in our upstream repo.
We can clean things up by running

git tag -l | xargs git tag -d
git fetch --tags

but it would be good to just don't mess up things in the first place.

As I said, we're new to commitizen, so maybe there is an easier way to achive this

Additional context

No response

You must be logged in to vote

That's great @TheKangaroo ! Glad to hear you found a solution!

For reference in commitizen you could do:

cz bump --files-only --yes --changelog
git commit -am "bump: release $(cz version --project)"

And later on to create the tag:

git tag $(cz version --project)

Commitizen works well with git, and where commitizen is available you know git will be available, this gives you a lot of flexibility.

Maybe we could add this as a tutorial? 🤔

Replies: 4 comments 1 reply

Comment options

This workflow would work better for my team as well

You must be logged in to vote
0 replies
Comment options

Can you expand on your workflow @bruno-fs ?

You must be logged in to vote
0 replies
Comment options

I have to admit, we switched to release-it with conventional-changelog and bumper plugin for our release workflow, which made our workflow work without any hacks.

You must be logged in to vote
0 replies
Comment options

That's great @TheKangaroo ! Glad to hear you found a solution!

For reference in commitizen you could do:

cz bump --files-only --yes --changelog
git commit -am "bump: release $(cz version --project)"

And later on to create the tag:

git tag $(cz version --project)

Commitizen works well with git, and where commitizen is available you know git will be available, this gives you a lot of flexibility.

Maybe we could add this as a tutorial? 🤔

You must be logged in to vote
1 reply
Comment options

Searched for hours to find this, that after a "--files-only" a manual git tag is needed. I was looking for a flag in "cz bump" Add: this is not complete if you use tag_format. I guess there is no way to get the tag?
cz version --project --tag

Answer selected by woile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type: feature A new enhacement proposal
Converted from issue

This discussion was converted from issue #612 on April 28, 2023 12:50.

AltStyle によって変換されたページ (->オリジナル) /