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

Do not fail on unexisting GitHub/GitLab template variables #659

Open
1 task done
orhun opened this issue May 26, 2024 · 0 comments
Open
1 task done

Do not fail on unexisting GitHub/GitLab template variables #659

orhun opened this issue May 26, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@orhun
Copy link
Owner

orhun commented May 26, 2024

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

When the github or gitlab feature isn't enabled and any remote-related template variable such as github.contributors is being used, git-cliff fails with the following error:

$ cargo run --no-default-features -- -c examples/github.toml

 ERROR git_cliff > Template render error:
Variable `github.contributors` not found in context while rendering 'template'

Desired solution

We should warn the user with a message like:

WARN: You seem to be using a GitHub-related variable but GitHub feature is not enabled.

Alternatives considered

None.

Additional context

I think we can add the RemoteReleaseMetadata to the Release struct even though the GitHub feature isn't enabled and warn the user instead (via checking the used variables via contains_variable method).

@orhun orhun added bug Something isn't working good first issue Good for newcomers labels May 26, 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 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant