Skip to content

Commit 06e6e70

Browse files
Do not fail if no successful run is found for the toolchain distribution
If no successful run is found for the toolchain distribution, the script will now print a message and return without failing. This is just annoying when the toolchain has not been built for a while.
1 parent e43d990 commit 06e6e70

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/gh-distribute-toolchain

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,8 @@ def latest_success_run_id(gh: GitHub, workflow_name: str, branch: str, scheme: s
828828
_, artifact_scheme, _ = derive_platform_suffix_and_scheme(artifact_name, scheme)
829829
if artifact_scheme == scheme:
830830
return run["id"]
831-
raise Exception(f"Could not find a successful run for {workflow_name} on {branch} branch with scheme {scheme}")
831+
print(f"Could not find a successful run for {workflow_name} on {branch} branch with scheme {scheme}")
832+
return None
832833

833834

834835
async def main():
@@ -851,6 +852,9 @@ async def main():
851852
if run_id == "latest":
852853
run_id = latest_success_run_id(
853854
gh, workflow_name="build-toolchain.yml", branch="main", scheme=options.scheme)
855+
if run_id is None:
856+
# No successful run found. This scheme might not be built recently.
857+
return
854858
run_id = str(run_id)
855859
print(f"Automatically determined run_id: {run_id}")
856860
await Distribution(gh, swift_gh, run_id, secrets,

0 commit comments

Comments
 (0)