Skip to content

Commit 3a865e4

Browse files
committed
Check for gh tool during sanity checks
Add a sanity check to verify that the GitHub CLI (gh) tool is available in PATH before proceeding with the release. This prevents the release process from failing late in the process when gh is needed for creating PRs in vendor repositories. Fixes #1433 Generated-by: Claude Opus 4.5
1 parent 7af687f commit 3a865e4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

release.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,13 @@ def sanity_check_bump_linux(source_tarball_uri):
412412
'to call builders and not source generation')
413413

414414

415+
def sanity_check_gh_tool():
416+
if shutil.which('gh') is None:
417+
error("The 'gh' (GitHub CLI) tool is required but was not found in PATH.\n"
418+
"Please install it from: https://cli.github.com/")
419+
print_success("GitHub CLI (gh) tool is available")
420+
421+
415422
def sanity_checks(args, repo_dir):
416423
print("Safety checks:")
417424
sanity_package_name_underscore(args.package, args.package_alias)
@@ -431,6 +438,7 @@ def sanity_checks(args, repo_dir):
431438
sanity_check_cmake_version(args.package, args.version)
432439
sanity_project_package_in_stable(args.version, args.upload_to_repository)
433440

441+
sanity_check_gh_tool()
434442
check_credentials(args.auth_input_arg)
435443
print_success("Jenkins credentials are good")
436444
shutil.rmtree(repo_dir)

0 commit comments

Comments
 (0)