Git Product home page Git Product logo

Comments (28)

woile avatar woile commented on September 22, 2024 1

Please review #25 it should solve the issue and bring back functionality

from commitizen-action.

Kurt-von-Laven avatar Kurt-von-Laven commented on September 22, 2024 1

@datanrd, No tag found to do an incremental changelog suggests to me that you may have started doing a sparse checkout by failing to pass fetch-depth: 0 to actions/checkout. A sparse checkout does not include tags, so Commitizen cannot do its job.

from commitizen-action.

adam-grant-hendry avatar adam-grant-hendry commented on September 22, 2024 1

@Kurt-von-Laven @woile I'm not thinking; I'm sorry. I need fetch-depth to checkout the last version tag, not the new one I'm trying to create.

from commitizen-action.

Kurt-von-Laven avatar Kurt-von-Laven commented on September 22, 2024 1

Yeah, and just to be clear for the sake of anyone following this thread, my understanding is that passing fetch-depth: n for any value of n other than 0, retrieves no tags at all since you are still doing a sparse checkout.

from commitizen-action.

Kurt-von-Laven avatar Kurt-von-Laven commented on September 22, 2024 1

Oh, I see your point. Maybe this is a feature request for commitizen-tools/commitizen in that case? @woile will know better than I though.

from commitizen-action.

adam-grant-hendry avatar adam-grant-hendry commented on September 22, 2024 1

@Kurt-von-Laven @woile nvm, I figured it out. I had to use your repo plus https://github.com/ncipollo/release-action. See this run

from commitizen-action.

woile avatar woile commented on September 22, 2024 1

No, it should've been closed. @metya this ticket discusses multiple different problems, please open a new issue with your problem and provide more information.

In github actions if you use the GITHUB_TOKEN, it behaves as using [skip-ci].

If you need to add [skip-ci] it won't solve anything in github actions, because it doesn't care about it. But you can add it by using:

[tool.commitizen]
bump_message = "release $current_version → $new_version [skip-ci]"

Alternatively, you can skip a commit in github actions using:

if: "!startsWith(github.event.head_commit.message, 'bump:')"

see commitizen action

If you need to make a release, look at commitizen's documentation

I'm closing this as it's off-topic, please open new issues for other problems

from commitizen-action.

floredelasteyrie avatar floredelasteyrie commented on September 22, 2024

I'm having the same issue.
Also, it's a problem that it breaks existing CIs in which I have fixed the version - which worked fine until the underlying package changed.

Using the action:

id: commitizen
uses: commitizen-tools/[email protected]
with:
    github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

Logs from my failing workflow:

Commitizen version:
2.21.0
Running cz:   --changelog 
[NO_COMMITS_TO_BUMP]
The commits found are not elegible to be bumped
chore(version): 0.6.2 → 0.6.2
tag to create: 0.6.2
increment detected: None

from commitizen-action.

woile avatar woile commented on September 22, 2024

That's very strange, gonna take a look, thanks for reporting!

from commitizen-action.

woile avatar woile commented on September 22, 2024

Could you share some samples of the commits that are not being detected?

thanks!

from commitizen-action.

floredelasteyrie avatar floredelasteyrie commented on September 22, 2024

I think I didn't give enough details, sorry about that !

For my part the problem isn't that the commit isn't detected, but rather that now the action fails for a specific case when before it didn't :)
So feat or fix commits work fine, but ci or perf commits make the whole CI fail.
I solved it for the moment by using continue-on-error: true in my workflow, but I'm afraid of the other errors this could lead to.

I assume it's due to this patch : commitizen-tools/commitizen#473
But the fact that the version of the action (v0.11.0) can use different package versions is a problem - shouldn't we choose to update the action to use a new version of Commitizen ?

from commitizen-action.

woile avatar woile commented on September 22, 2024

I think we could make the action point to latest by default, or manually enter the version.
I think the problem here is that I introduced a change that I didn't think was gonna break commitizen.
It should've been a major release if I had known better, I apologise for that 🙏🏻

from commitizen-action.

woile avatar woile commented on September 22, 2024

I've created a PR to introduce the version, if you could review I'd appreciate

#20

from commitizen-action.

floredelasteyrie avatar floredelasteyrie commented on September 22, 2024

Great idea to be able to manually enter the version while keeping the original latest by default :)

Thanks a lot for the quick fix ! I looked at the PR and added a comment - I'm not very familiar with the codebase but can review if needed !

from commitizen-action.

datanrd avatar datanrd commented on September 22, 2024

@floredelasteyrie I've proposed another option in #21 that may be useful to your situation as well.

from commitizen-action.

woile avatar woile commented on September 22, 2024

New changes to revert back the version were introduced already in this action.
I'm working on this PR as well: commitizen-tools/commitizen#489 which I'll then integrate into this action

from commitizen-action.

adam-grant-hendry avatar adam-grant-hendry commented on September 22, 2024

@woile Is this not fixed yet? I am having the same issue on:

commitizen: 2.35.0
commitizen-tools/commitizen-action: 0.15.0

from commitizen-action.

woile avatar woile commented on September 22, 2024

What happens if you do git tag in the CI? Does any version appear?

from commitizen-action.

adam-grant-hendry avatar adam-grant-hendry commented on September 22, 2024

@woile @Kurt-von-Laven How can I push without triggering CI? GitHub supports adding a comment to the commit message, like [skip ci] that will skip CI.

Can I do this somehow with the commitizen-action?

from commitizen-action.

adam-grant-hendry avatar adam-grant-hendry commented on September 22, 2024

@Kurt-von-Laven @woile I suppose for now, I can add

if: "!startsWith(github.event.head_commit.message, 'bump:')"

to the beginning of those workflow jobs I don't want to run when this happens.

Just wondering if there's another way to do this?

from commitizen-action.

woile avatar woile commented on September 22, 2024

You could customize the bump commit message to include skip ci and use that condition with skip ci instead of bump:

from commitizen-action.

adam-grant-hendry avatar adam-grant-hendry commented on September 22, 2024

@woile How do you customize the message from within a GitHub Actions workflow?

from commitizen-action.

Kurt-von-Laven avatar Kurt-von-Laven commented on September 22, 2024

Do the official Commitizen docs answer your question?

from commitizen-action.

adam-grant-hendry avatar adam-grant-hendry commented on September 22, 2024

Do the official Commitizen docs answer your question?

No because that gives you general information about how to customize all commit messages, but we would need to customize the message to have a comment if the bump: is in the message.

This probably involves some form of a regular expression I'm sure...

from commitizen-action.

adam-grant-hendry avatar adam-grant-hendry commented on September 22, 2024

No worries at all. I'm sure I could figure it out if I devoted more time to it, but it's more time than I have to commit at the given moment. It would be nice as an example added to the documentation, so a feature request sounds appropriate.

from commitizen-action.

adam-grant-hendry avatar adam-grant-hendry commented on September 22, 2024

@Kurt-von-Laven @woile I need to

  • bump versions
  • build multiple wheels to that version for different platforms, and finally
  • create a release with all the wheels

I'm trying to figure out how to do this. I'm not able to update a release once it's created, but I'm also not finding a way to pass ${{ env.REVISION }} from the bump version step to the release step (${{ github.ref_name }} is main for me, not my tag).

How can I achieve this?

from commitizen-action.

metya avatar metya commented on September 22, 2024

Any news about the issue?
I have the same problem and don't know how to fix.

from commitizen-action.

Kurt-von-Laven avatar Kurt-von-Laven commented on September 22, 2024

@metya, are you already passing fetch-depth: 0 to actions/checkout? I'm actually not sure why this issue is still open. @woile, did you envision some further change beyond #20 and #25?

@adam-grant-hendry, I recently learned of semantic-release, which may be helpful to you or others in the future with more complex use cases.

from commitizen-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.