-
Notifications
You must be signed in to change notification settings - Fork 43
Is there a way of knowing if bump detected an increment? #18
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
Comments
If you are writing a POSIX shell script, you can do something like: #!/bin/sh -e
if cz bump; then
echo 'it was bumped correctly'
else
echo "there was an error, whose error code is $?"
exit 3 # 3 is the error code thrown by no commits found
fi |
Thanks for your answer @woile. Unfortunately, it looks like $ cz bump --changelog
bump: version 1.3.0 → 1.3.0
tag to create: 1.3.0
increment detected: None
$ echo $?
0 And the same result happens when using this action in a workflow: https://github.com/now8-org/app/runs/4832942786?check_suite_focus=true (check the commitizen step output). |
Nice catch, it is actually a bug on commitizen, not on this github action, I've submitted a PR to cz. commitizen-tools/commitizen#473 Thanks for reporting |
Can you test with the latest version? |
It's working now. Thanks. In case it helps anyone what I did to condition the execution of subsequent steps was: - name: commitizen
id: commitizen
continue-on-error: true
uses: commitizen-tools/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Some other task
if: steps.commitizen.outcome == 'success'
run: something |
I would like to programatically disable subsequent steps in a workflow if no increment is detected in this action (If
cz bump
detects no increment).Does it make sense to add an output variable that states whether or not an increment was detected or is there a simpler way of approaching this?
The text was updated successfully, but these errors were encountered: