Skip to content

Commit 4490ae1

Browse files
Update new-change to not put in empty prs
This updates new-change to not add in an empty pr if the template section for prs is empty
1 parent d5b8484 commit 4490ae1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • .changes/smithy_changelog

.changes/smithy_changelog/new.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,12 @@ def parse_filled_in_contents(contents: str) -> Change | None:
161161
if "type" not in parsed and line.startswith("type:"):
162162
parsed["type"] = ChangeType[line.split(":")[1].strip().upper()]
163163
if "pull_requests" not in parsed and line.startswith("pull requests:"):
164-
parsed["pull_requests"] = [
165-
pr.strip() for pr in line.split(":")[1].strip().split(",")
166-
]
164+
prs: list[str] = []
165+
for pr in line.split(":")[1].strip().split(","):
166+
pr = pr.strip()
167+
if pr:
168+
prs.append(pr)
169+
parsed["pull_requests"] = prs
167170
elif "description" not in parsed and line.startswith("description:"):
168171
# Assume that everything until the end of the file is part
169172
# of the description, so we can break once we pull in the

0 commit comments

Comments
 (0)