From 3ee930925caad78ef4b5df4dbec128e84a4e701c Mon Sep 17 00:00:00 2001 From: Luka Skugor Date: Mon, 14 Oct 2024 13:36:19 +0000 Subject: [PATCH] Enable republish of release notes --- release-controller/publish_notes.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/release-controller/publish_notes.py b/release-controller/publish_notes.py index eaaedda49..44cf805b1 100644 --- a/release-controller/publish_notes.py +++ b/release-controller/publish_notes.py @@ -5,6 +5,7 @@ from dotenv import load_dotenv from github import Auth from github import Github +from github import ContentFile from github.Repository import Repository import markdown @@ -67,7 +68,13 @@ def ensure_published(self, version: str, changelog: str): """Publish the release notes for the given version.""" branch_name = f"replica-release-notes-{version}" pull_head = f"dfinity:{branch_name}" - if self.repo.get_pulls(head=pull_head, state="all").totalCount > 0: + published_releases = self.repo.get_contents("f/{REPLICA_RELEASES_DIR}") + if not isinstance(published_releases, list): + return + if any(version in f.path for f in published_releases): + return + + if self.repo.get_pulls(head=pull_head, state="open").totalCount > 0: return version_path = f"{REPLICA_RELEASES_DIR}/{version}.md"