git-cliff
git-cliff copied to clipboard
Running git cliff in the Gitlab CI results in an 'IO error'
// offtopic: git-cliff is my favourite changelog generation tool after trying a lot of them. So thanks for that!
Describe the bug
When running git-cliff in the Gitlab CI. The tool results an IO error. Not sure where to go from here. Executing pwd
gives the correct path, that includes a .git
directory.
Expected behavior It would run in the same way as it does locally.
Screenshots/Logs
System (please complete the following information):
- OS Information: CI image is an alpine based image
- Project Version: 0.4.0 musl
After some research, adding -r .
did the trick for me. Although I thought this would be the default setting?
I have issue using git cliff in the Gitlab CI Could you share your config on that ?
Hello!
After some research, adding
-r .
did the trick for me. Although I thought this would be the default setting?
Yes, "current directory" is the default setting for the repository path.
https://github.com/orhun/git-cliff/blob/f447cc2e73ea707c2f4694507e9c7847fcff29e9/git-cliff/src/lib.rs#L101-L102
According to the documentation of std::env::current_dir:
Returns an [
Err
] if the current working directory value is invalid. Possible cases:
- Current directory does not exist.
- There are insufficient permissions to access the current directory.
In your case, maybe git-cliff
cannot access the current directory due to insufficient permissions. Can you check this with another command?
I have issue using git cliff in the Gitlab CI Could you share your config on that ?
That would be nice actually. (FYI I created #21)
I see the config I finally made it (run git-cliff) But still have an issue I create an example of with workflow but it actually work so not the minimum example of something not working https://gitlab.com/alteregoart/git-cliff-test (not the best example so I create the bare minimum and share it with you on #21 )
In your case, maybe
git-cliff
cannot access the current directory due to insufficient permissions. Can you check this with another command?
The permissions are correct. So it must be something else. It's running in an alpine container.
I think the issue is coming from the fact that you are using alpine container (I used alpine container, git-cliff failed, I changed to regular one everything worked fine).
Could you try to use a regular container (not an alpine one) ?
Any updates on this?
Just read the generated description into a variable like I am doing on GitLab.
RELEASE_DESCRIPTION=$(./git-cliff ${LATEST_TAG}.. --tag "${NEW_TAG}")