release notes: do not publish when a PR's files could not be read

A failed lookup filed the PR under Other and the notes were still written.
Print them, but leave the release alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-11-17 19:41:47 -08:00
1 parent 8ce51ce629
commit f697808439
1 file changed
+6
@@ -257,11 +257,14 @@ def main():
body = json.loads(gh("release", "view", args.tag, "-R", args.repo, "--json", "body"))["body"]
failed = []
def pr_files(num):
try:
out = gh("pr", "view", str(num), "-R", args.repo, "--json", "files", "--jq", ".files[].path")
except subprocess.CalledProcessError as e:
print("warning: files of #%d: %s" % (num, e.stderr.strip()), file=sys.stderr)
failed.append(num)
return []
return out.split()
@@ -269,6 +272,9 @@ def main():
if notes.strip() == body.replace("\r\n", "\n").strip():
print("release %s: notes already grouped, nothing to change" % args.tag, file=sys.stderr)
sys.stdout.write(notes)
if failed and args.write:
sys.exit("release %s: not writing, could not read the files of %s"
% (args.tag, ", ".join("#%d" % n for n in failed)))
if args.write:
gh("release", "edit", args.tag, "-R", args.repo, "--notes-file", "-", stdin=notes)
print("release %s: notes updated" % args.tag, file=sys.stderr)