Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 committed May 28, 2024
1 parent ec58837 commit 425df30
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions scripts/release-note.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,18 @@ def extract_release_contents(target: str, cur_tag: str, prev_tag: str) -> str:
start_pos = document.find(start_marker)

if start_pos == -1:
raise ValueError(f"Start marker for tag '{cur_tag}' not found in {target}.")
raise ValueError(f"Start marker for tag '{cur_tag}' not found in {target}")

start_pos += len(start_marker) + len("YYYY-MM-DD")
end_marker = f"## [{prev_tag}]" if prev_tag else "<!-- Release links -->"
end_pos = document.find(end_marker, start_pos)

if prev_tag:
end_pos = document.find(end_marker, start_pos)
if end_pos == -1:
raise ValueError(
f"End marker for previous tag '{prev_tag}' not found in {target}."
)
else:
end_pos = document.find(end_marker, start_pos)
if end_pos == -1:
raise ValueError(f"End marker '{end_marker}' not found in {target}.")
if end_pos == -1:
raise ValueError(
f"End marker for previous tag '{prev_tag}' not found in {target}"
if prev_tag
else f"End marker '{end_marker}' not found in {target}"
)

return document[start_pos:end_pos].strip()

Expand Down

0 comments on commit 425df30

Please sign in to comment.