Skip to content
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

How to use pre_bump_hook scripts with this action #78

Open
dirceu-cit opened this issue Dec 5, 2023 · 1 comment
Open

How to use pre_bump_hook scripts with this action #78

dirceu-cit opened this issue Dec 5, 2023 · 1 comment

Comments

@dirceu-cit
Copy link

Hi all,

Question here:

I am interested in using this pre-bump-hooks built-in commitizen feature to update my repository documentation before create the tag and push the commit, like it is said in the site:

Useful when you need to generate documentation based on the new version. During execution of the script, some environment variables are available

It works pretty well in a local machine using the installed commitizen version (pip install -U commitizen) but, if I understood correctly, this action is a Docker Action, which means that it runs inside a pre-built docker image which does not contain the scripts that is referenced in my .cz.yaml configuration file, unless if I was able to mount a volume in this image containing my script, for instance (not sure if it is a regular approach in github actions - volume mount)

Is there any way to do it? Are you have some related issue in the roadmap?

Thanks in advance

@woile
Copy link
Member

woile commented Dec 6, 2023

The Docker image has your code mounted automatically. Otherwise it wouldn't be able to find the pyproject.toml or the .cz.toml depending on which one you are using. Now, the potential problem I see with the bump hooks is that if your dependencies require something that is not in the docker image... it becomes quite complicated to run the hook. If it's something like mkdocs, you can add it to extra_requirements and it should work.

Alternatively, you can split the version updates on the files, and the commit creation:

- run: cz bump --files-only
- run: ./scripts/docs
- run: git commit -am "bump: new version $(cz version -p)"

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

No branches or pull requests

2 participants