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

Gitlab CI, git-cliff is working on v0.4.0, git repo is set, config file is here but no changelog ... #22

Closed
alteregoart opened this issue Oct 15, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@alteregoart
Copy link
Contributor

Describe the bug
I set the Gitlab CI with the following stage

changelog:
  image:
    name: orhunp/git-cliff:latest
    entrypoint: [""]
  stage: doc
  script:
    - git-cliff

here is the result on Gitlab CI
gitlab-ci

here on local
local

I don't understand why it is not working.
I try to reproduce the error but impossible on a new repo :/
If you have any idea where it can come from

System (please complete the following information):

  • OS Information: Ubuntu (but this part is working fine) & Gitlab CI
  • Project Version: 0.4.0
@alteregoart alteregoart added the bug Something isn't working label Oct 15, 2021
@orhun
Copy link
Owner

orhun commented Oct 17, 2021

Are you sure you have the full commit history in the current path that you're trying to run git-cliff?

I had a similar issue with GitHub actions where actions/checkout was only fetching the latest commit thus makes the git-cliff create an empty changelog. For the record, here is how you solve it:

- uses: actions/checkout@v2
  with:
    fetch-depth: 0

Maybe GitLab has something similar?

@orhun
Copy link
Owner

orhun commented Oct 18, 2021

I see you created #24, does that mean you have solved this issue?

@alteregoart alteregoart changed the title Gitlab CI, git-cliff working v0.4.0, git repo is set, config file is here but no changelog ... Gitlab CI, git-cliff is working on v0.4.0, git repo is set, config file is here but no changelog ... Oct 18, 2021
@alteregoart
Copy link
Contributor Author

Unfortunately, I still have the issue 😞

I think I have the full history, I tried on another job and had the following:
Capture d’écran de 2021-10-18 21-40-34
)

I have no idea how to debug this. Do you have any idea ?

@orhun
Copy link
Owner

orhun commented Oct 18, 2021

I actually tried the first workflow you posted and it worked for me.

Are you using the default cliff.toml file? If it is customized, maybe that's causing the changelog to be empty.

@alteregoart
Copy link
Contributor Author

Yep i know it worked I use it on another repository without any issue but on this one.

Yes i am using the default cliff.toml file. On my machine everything is working fine but on the CI it is not working :/

@orhun
Copy link
Owner

orhun commented Oct 18, 2021

Is this a public repository? I want to take a look.

@alteregoart
Copy link
Contributor Author

This is a private repo 😥
I could give you access to it either way

@pataar
Copy link
Contributor

pataar commented Oct 19, 2021

Hi, try to set these variables in the job to make a full clone:

  variables:
    GIT_STRATEGY: clone # clone entire repo instead of reusing workspace
    GIT_DEPTH: 0 # avoid shallow clone to give cliff all the info it needs]

(Similar to fetch-depth: 0)

Also I'm using -w . in addition to -r .. Perhaps the combination of those two solves your issue.

@alteregoart
Copy link
Contributor Author

It works !!!

That's so good !

I am wondering why my example is running then :/

@alteregoart
Copy link
Contributor Author

I have updated the PR accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants