Skip to content

Commit 7e1bb7a

Browse files
committed
fix(changelog): add CI-only trailing newline for prepend
Render an extra trailing newline from the git-cliff body template when running in GitHub Actions so --prepend separates new release notes from existing changelog content.
1 parent 19d4ab1 commit 7e1bb7a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

release/changelog/cliff.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ body = """
99
{%- set version_prefix = get_env(name="CLIFF_VERSION_PREFIX", default="v") -%}
1010
{%- set gh_url = get_env(name="GITHUB_SERVER_URL", default="https://github.com") ~ "/" ~ get_env(name="GITHUB_REPOSITORY", default="") -%}
1111
{%- set use_emojis = get_env(name="CLIFF_USE_EMOJIS", default="false") == "true" -%}
12+
{%- set github_actions = get_env(name="GITHUB_ACTIONS", default="false") == "true" -%}
1213
{% if version %}\
1314
{%- set ver_stripped = version | trim_start_matches(pat=version_prefix) -%}
1415
{%- set ver = version_prefix ~ ver_stripped -%}
@@ -30,6 +31,8 @@ body = """
3031
([`{{ commit.id | truncate(length=7, end="") }}`]({{ gh_url }}/commit/{{ commit.id }}))\
3132
{% endfor %}
3233
{% endfor %}
34+
{%- if github_actions %}
35+
{% endif %}
3336
"""
3437
# Remove leading and trailing whitespaces from the changelog's body.
3538
trim = true

0 commit comments

Comments
 (0)