Skip to content

Commit

Permalink
Enable republish of release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleChimera committed Oct 14, 2024
1 parent cbb872b commit 3ee9309
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion release-controller/publish_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 3ee9309

Please sign in to comment.