From 90e2fdd834fad72d492eebfb215b8030ff31ba9d Mon Sep 17 00:00:00 2001 From: Ruben Simons Date: Wed, 4 Feb 2026 15:06:20 +0100 Subject: [PATCH 1/2] Add script to clean GitHub release notes --- .../.ci/scripts/clean_gh_release_notes.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 templates/github/.ci/scripts/clean_gh_release_notes.py diff --git a/templates/github/.ci/scripts/clean_gh_release_notes.py b/templates/github/.ci/scripts/clean_gh_release_notes.py new file mode 100755 index 00000000..f575df79 --- /dev/null +++ b/templates/github/.ci/scripts/clean_gh_release_notes.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 + +# This script is running with elevated privileges from the main branch against pull requests. + +# This script cleans the input from artifacts which are used by the pulp documentation internally, but clutter for GitHub releases +import re +import sys + +RE_VERSION = re.compile(r"^## (\d+\.\d+\.\d+)") + +def main(): + # Print disclaimer: + version_str = "" + for line in sys.stdin: + if line.endswith("\n"): + line = line[:-1] + if line.startswith("#"): + print(line.split(" {: #")[0]) + match = RE_VERSION.match(line) + if match and version_str == "": + version_str = match.group(1) + print("") + print("> [!NOTE]") + print(f"> Changes are also available on [Pulp docs](https://pulpproject.org/pulpcore/changes/#{version_str})") + else: + print(line) + + +if __name__ == "__main__": + main() From 9f1f5167007acc3cf892f8a33346caf267622a8d Mon Sep 17 00:00:00 2001 From: Ruben Simons Date: Wed, 4 Feb 2026 15:12:05 +0100 Subject: [PATCH 2/2] Use clean_gh_release_notes in GitHub release pipeline --- templates/github/.github/workflows/publish.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/github/.github/workflows/publish.yml.j2 b/templates/github/.github/workflows/publish.yml.j2 index 4171bcf4..e146cb9d 100644 --- a/templates/github/.github/workflows/publish.yml.j2 +++ b/templates/github/.github/workflows/publish.yml.j2 @@ -154,7 +154,7 @@ jobs: run: | # The last commit before the release commit contains the release CHANGES fragments git checkout "${TAG_NAME}~" - NOTES=$(towncrier build --draft --version $TAG_NAME) + NOTES=$(towncrier build --draft --version $TAG_NAME | .ci/scripts/clean_gh_release_notes.py) echo "body<> $GITHUB_OUTPUT echo "$NOTES" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT