Skip to content

Commit ea7ed7d

Browse files
committed
improve error message in bump_version.py
1 parent 665065c commit ea7ed7d

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

.github/workflows/bump_version.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,14 @@ def main():
140140
) from exc
141141
title, notes = get_release_notes()
142142
print("Pushed commit to 'Bump version to", tag, "'")
143-
gh_cmd = [
144-
"gh",
145-
"release",
146-
"create",
147-
tag,
148-
"--title",
149-
title,
150-
"--notes",
151-
notes,
152-
]
143+
gh_cmd = ["gh", "release", "create", tag, "--title", title, "--notes", notes]
153144
if Updater.component == "rc":
154145
gh_cmd.append("--prerelease")
155-
subprocess.run(gh_cmd, check=True)
156-
print("Created tag", tag, "and corresponding GitHub Release")
146+
try:
147+
subprocess.run(gh_cmd, check=True)
148+
print("Created tag", tag, "and corresponding GitHub Release")
149+
except subprocess.CalledProcessError as exc:
150+
raise RuntimeError("Failed to create GitHub Release") from exc
157151

158152

159153
if __name__ == "__main__":

0 commit comments

Comments
 (0)