You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please take a look at cliff.toml and GitLab (Discussion #730)
new contributors Needs the merge_number after the !
There seems to be a bug with this, I'm not sure what is going on. Feel free to create a separate issue and I can look into it.
In the meantime you can add a guard like this:
{% for contributor in contributors %}{% if contributor.pr_number -%}\* [@{{ contributor.username }}](https://gitlab.com/{{ contributor.username }}) made their first contribution in [!{{ contributor.pr_number }}](<REPO>/-/merge_requests/{{ contributor.pr_number }})\{% endif -%}\{%- endfor %}\n
Is it possible to put this lines into the code below? The error message witch I get is:
git-cliff -r . > CHANGELOG.md
WARN git_cliff_core::changelog > You are using an experimental feature! Please report bugs at <https://git-cliff.org/issues>
ERROR git_cliff > Template render error:
Variable `contributors` not found in context while rendering 'template'
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1
cliff.toml
# git-cliff ~ configuration file# https://git-cliff.org/docs/configuration
[remote.gitlab]
owner = "user"repo = "test"token = ""
[changelog]
# template for the changelog body# https://keats.github.io/tera/docs/#introductionheader = """# Changelog\nThis is an automated changelog based on the commits in this repository.\n### ReleasesCheck the notes in the [releases](https://gitlab.com/user/test/-/releases) for more information."""# https://keats.github.io/tera/docs/#introductionbody = """{% if version -%}\ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}{% else %}\ ## [Unreleased]{% endif -%}\{% for group, commits in commits | group_by(attribute="group") %} ### {{ group | upper_first }} {% for commit in commits %} - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first | trim }} ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }}))\ {% if commit.gitlab.username and commit.gitlab.username != remote.gitlab.owner %} by [@{{ commit.gitlab.username }}](https://gitlab.com/{{ commit.gitlab.username }}){%- endif -%} {% if commit.gitlab.pr_number %} in [#{{ commit.gitlab.pr_number }}]( <REPO>/-/commit/{{ commit.gitlab.pr_number }}){%- endif -%} {% endfor %}{% endfor %}{%- if gitlab.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} ## New Contributors{%- endif -%}{% for contributor in gitlab.contributors | filter(attribute="is_first_time", value=true) %} * [@{{ contributor.username }}](https://gitlab.com/{{ contributor.username }}) made their first contribution in [!{{ contributor.pr_number }}](<REPO>/-/merge_requests/{{ contributor.pr_number }})\{%- endfor %}\n"""# changelog footerfooter = """{% for release in releases -%} {% if release.version -%} {% if release.previous.version -%} [{{ release.version | trim_start_matches(pat="v") }}]: \ <REPO>/-/compare/{{ release.previous.version }}...{{ release.version }} {% endif -%} {% else -%} [unreleased]: <REPO>/-/compare/{{ release.previous.version }}...HEAD {% endif -%}{% endfor %}"""# remove the leading and trailing whitespace from the templatetrim = truepostprocessors = [
{ pattern = '<REPO>', replace = "https://gitlab.com/joklein/test" }, # replace repository URL
]
[git]
# https://www.conventionalcommits.org# parse the commits based on https://www.conventionalcommits.orgconventional_commits = true# filter out the commits that are not conventionalfilter_unconventional = true# process each line of a commit as an individual commitsplit_commits = false# regex for preprocessing the commit messagescommit_preprocessors = [
# Replace issue numbers
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/merge_requests/${2}))" },
{ pattern = '\(!([0-9]+)\)', replace = "([!${1}](<REPO>/-/merge_requests/${1}))" },
]
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Refactor" },
{ message = "^style", group = "Styling" },
{ message = "^test", group = "Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore\\(deps\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(commit\\)", skip = true },
{ message = "^chore|ci", group = "Miscellaneous Tasks" },
{ body = ".*security", group = "Security" },
{ message = "^revert", group = "Revert" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parserprotect_breaking_commits = false# filter out the commits that are not matched by commit parsersfilter_commits = false# regex for matching git tags# tag_pattern = "v[0-9].*"# regex for skipping tags# skip_tags = ""# regex for ignoring tags# ignore_tags = ""# sort the tags topologicallytopo_order = false# sort the commits inside sections by oldest/newest ordersort_commits = "newest"# limit the number of commits included in the changelog.# limit_commits = 42
The text was updated successfully, but these errors were encountered:
orhun
changed the title
New contributors needs the merge_number after the !
GitLab does not have merge request number for new contributors
Aug 23, 2024
Please take a look at cliff.toml and GitLab (Discussion #730)
new contributors Needs the merge_number after the !
There seems to be a bug with this, I'm not sure what is going on. Feel free to create a separate issue and I can look into it.
In the meantime you can add a guard like this:
Is it possible to put this lines into the code below? The error message witch I get is:
cliff.toml
The text was updated successfully, but these errors were encountered: