git-cliff icon indicating copy to clipboard operation
git-cliff copied to clipboard

Running git cliff in the Gitlab CI results in an 'IO error'

Open pataar opened this issue 2 years ago • 8 comments

// 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 image

System (please complete the following information):

  • OS Information: CI image is an alpine based image
  • Project Version: 0.4.0 musl

pataar avatar Oct 14 '21 11:10 pataar

After some research, adding -r . did the trick for me. Although I thought this would be the default setting?

pataar avatar Oct 14 '21 14:10 pataar

I have issue using git cliff in the Gitlab CI Could you share your config on that ?

alteregoart avatar Oct 14 '21 18:10 alteregoart

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)

orhun avatar Oct 15 '21 18:10 orhun

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 )

alteregoart avatar Oct 15 '21 19:10 alteregoart

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.

pataar avatar Oct 19 '21 09:10 pataar

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) ?

alteregoart avatar Oct 19 '21 10:10 alteregoart

Any updates on this?

orhun avatar Oct 29 '21 22:10 orhun

Just read the generated description into a variable like I am doing on GitLab.

RELEASE_DESCRIPTION=$(./git-cliff ${LATEST_TAG}.. --tag "${NEW_TAG}")

DeveloperC286 avatar Jan 08 '22 22:01 DeveloperC286