From d17699b12dde9e1651e762f7ada45396615ad571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skyler=20M=C3=A4ntysaari?= Date: Sat, 29 Mar 2025 10:44:50 +0200 Subject: [PATCH] fix(ci): Improve annotations handling in renovate release notes script --- .github/scripts/renovate-releasenotes.py | 11 +++++++---- .github/workflows/pr-validate.yaml | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/scripts/renovate-releasenotes.py b/.github/scripts/renovate-releasenotes.py index 527eaae..9dfb590 100755 --- a/.github/scripts/renovate-releasenotes.py +++ b/.github/scripts/renovate-releasenotes.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import sys +import io import typer from git import Repo @@ -189,9 +190,11 @@ def main( }) if annotations: - # Instead of trying to dump the list of annotations directly, we'll treat it as a string - annotations_list = [yaml.dump(item).rstrip() for item in annotations] - annotations_string = "\n".join(annotations_list) + annotations_stream = io.StringIO() + yaml.dump(annotations, annotations_stream) + + annotations_string = annotations_stream.getvalue() + annotations_stream.close() if "annotations" not in new_chart_metadata: new_chart_metadata["annotations"] = CommentedMap() @@ -200,7 +203,7 @@ def main( new_chart_metadata = bump_patch_version(new_chart_metadata) - with chart_metadata_file.open('w') as f: + with chart_metadata_file.open("w") as f: yaml.dump(new_chart_metadata, f) diff --git a/.github/workflows/pr-validate.yaml b/.github/workflows/pr-validate.yaml index 2fb41b9..7e9f1a1 100644 --- a/.github/workflows/pr-validate.yaml +++ b/.github/workflows/pr-validate.yaml @@ -24,6 +24,7 @@ jobs: uses: ./.github/workflows/charts-lint.yaml needs: - pr-metadata + - charts-changelog with: checkoutCommit: ${{ github.sha }} chartsToLint: ${{ needs.pr-metadata.outputs.chartsToLint }}