From 3a7626b121fe10df12df39bd5cc71be8085e113d Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sun, 6 Oct 2024 04:49:21 -0700 Subject: [PATCH] adjust bump-n-release script fix updating metadata files and escape doxygen command prefixes --- .github/workflows/cliff.toml | 7 +++++-- .github/workflows/increment_version.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cliff.toml b/.github/workflows/cliff.toml index f9ddb8d..f421e9d 100644 --- a/.github/workflows/cliff.toml +++ b/.github/workflows/cliff.toml @@ -35,7 +35,7 @@ body = """ ### {{ group | upper_first }} {% for commit in commits | unique(attribute="message") %} - {{ commit.message | split(pat="\n") | first | upper_first | trim }}\ - {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} + {% if commit.remote.username %} by \\@{{ commit.remote.username }}{%- endif -%} {% if commit.remote.pr_number %} in \ [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) {%- else %} in \ @@ -64,7 +64,7 @@ Full commit diff: [`{% if previous.version -%} {%- endif -%} {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} - * @{{ contributor.username }} made their first contribution + * \\@{{ contributor.username }} made their first contribution {%- if contributor.pr_number %} in \ [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ {%- endif %} @@ -88,6 +88,9 @@ filter_unconventional = false commit_preprocessors = [ # remove issue numbers from commits { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, + # escape doxygen command prefixes + { pattern = '\s(@\w)', replace = " \\$1" }, + { pattern = '\s(\\\w)', replace = " \\$1" }, ] # regex for parsing and grouping commits commit_parsers = [ diff --git a/.github/workflows/increment_version.py b/.github/workflows/increment_version.py index 92795cd..8b728a7 100644 --- a/.github/workflows/increment_version.py +++ b/.github/workflows/increment_version.py @@ -202,7 +202,7 @@ def main() -> int: print("New version:", ver_str) if args.update_metadata: - made_changes = made_changes or update_metadata_files(ver_str) + made_changes = update_metadata_files(ver_str) or made_changes print("Metadata file(s) updated:", made_changes) if "GITHUB_OUTPUT" in environ: # create an output variables for use in CI workflow