-
Notifications
You must be signed in to change notification settings - Fork 42
Pre-Bump Scripts do not have access to packages installed before using commitizen-tools/commitizen-action
#76
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
Interesting, I'm not sure how to solve this issue. The thing is that the action runs on its own docker image. |
That would explain it. So far, a fix I have found is to install the required packages within the same script however, the workflow takes wayy too long when I do this. |
Is it a possibility for you to re-write it in python or with coreutils? That's why I'm not a big fan |
Unfortunately, the scripts aren't portable to python due to tight dependence on the packages. |
What is your script doing? I'd consider if the step can be done outside commitizen. Which variables do you use from: https://commitizen-tools.github.io/commitizen/bump/#pre_bump_hooks |
I only make use of
Thanks for this, I can already see possible ways I can handle the scripts outside commitizen. The only downside is I'd have a |
You can have a step which installs commitizen with cz bump --git-output-to-stderr --dry-run | grep 'tag to create:' | grep -Eo '[0-9].+' > CZ_NEXT_VERSION
cat CZ_NEXT_VERSION Or directly into a github action variable: - name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install -U commitizen
- name: Next version
id: getnextversion
run: |
export NEXT_VERSION=$(cz bump --git-output-to-stderr --dry-run | grep 'tag to create:' | grep -Eo '[0-9].+')
echo "VERSION=$NEXT_VERSION" >> $GITHUB_OUTPUT
- name: Your NODEJS script
env:
CZ_PRE_NEW_VERSION: ${{ steps.getversion.outputs.VERSION }}
# HERE the commitizen action Note: I'm on a MAC so the I believe any change done in git will be picked up by commitizen and commit them in the |
Thanks @woile I'm going to give this a try and let you know how it goes |
I'm closing this since my issue has been addressed already by @woile. |
Background
I have a closed-sample project where I make use of
commitizen-action
to handle versioning and changelog generation. I make use of.cz.toml
'spre_bump_hooks
configuration to add shell scripts which should be executed before version bump commit. The idea was to run a couple of cleanups based on the version information.However, this fails as some external required packages are not made available to the scripts although they were installed in previous steps before
commitizen-tools/commitizen-action
is used.Example
release.yml
.cz.toml
scripts/pre-bump-scripts.sh
The script above fails with a command
node
not foundThe text was updated successfully, but these errors were encountered: