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

Github integration is not run when printing context (--context) #780

Closed
1 task done
janbuchar opened this issue Aug 1, 2024 · 8 comments · Fixed by #782
Closed
1 task done

Github integration is not run when printing context (--context) #780

janbuchar opened this issue Aug 1, 2024 · 8 comments · Fixed by #782
Assignees
Labels
bug Something isn't working

Comments

@janbuchar
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

Github integration is not run when printing context, so all the fields added by the integration are empty.

Steps To Reproduce

  1. set up github integration in cliff.toml
  2. run git cliff
  • observe a message about fetching release info from github
  1. run git cliff --context
  • no message is printed
  • *.github context fields are empty

Expected behavior

I'd expect the integration to run (and populate the context) in both cases.

Screenshots / Logs

No response

Software information

  • Operating system: Arch linux
  • Project version: 2.4.0

Additional context

No response

@janbuchar janbuchar added the bug Something isn't working label Aug 1, 2024
Copy link

welcome bot commented Aug 1, 2024

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

@orhun
Copy link
Owner

orhun commented Aug 2, 2024

Hey, are you using GitHub related fields (e.g. github.contributors) in your cliff.toml? GitHub data is not fetched as default as long as it is activated via config.

I tried the following and it worked fine:

git cliff --context -c github

@janbuchar
Copy link
Contributor Author

Hey, are you using GitHub related fields (e.g. github.contributors) in your cliff.toml? GitHub data is not fetched as default as long as it is activated via config.

Do I understand it right that I have to use those fields in my templates or else they won't be fetched? Currently I'm using commit.github.username and the context (printed with --context) looks fine 🤷

@orhun
Copy link
Owner

orhun commented Aug 2, 2024

Yup, that's correct.

@janbuchar
Copy link
Contributor Author

I see. The line of thought that led me here was that I configured the integration, then I wanted to check if it works by printing out the context and found that it was empty because I haven't touched the templates yet.

Also after #657 is implemented, I believe that users may want to do git-cliff -x and then use the github-related context fields in an external filter.

@orhun
Copy link
Owner

orhun commented Aug 2, 2024

I guess we can add another check where if the remote is configured we activate the integration also. That will likely solve your case as well since no modification on templates are needed. How does it sound?

@janbuchar
Copy link
Contributor Author

I guess we can add another check where if the remote is configured we activate the integration also. That will likely solve your case as well since no modification on templates are needed. How does it sound?

That sounds perfect!

@orhun
Copy link
Owner

orhun commented Aug 4, 2024

Implemented in #782, any chance that you can check it out locally? 😊

@orhun orhun closed this as completed in #782 Aug 4, 2024
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

Successfully merging a pull request may close this issue.

2 participants