Skip to content

Commit

Permalink
Add helpful error when gh is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins committed Jun 14, 2024
1 parent 75f02e5 commit 6ca7a58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/configure_trusted_publisher/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ def add_environment
return unless ask_yes_or_no("Would you like to add a github environment to allow customizing " \
"prerequisites for the action?")

if Bundler.which("gh").nil?
exit "The GitHub CLI (gh) is required to add a GitHub environment. " \
"Please install it from https://cli.github.com/ and try again."
end

env_name = "rubygems.org"

owner, name = github_repository
Expand Down

0 comments on commit 6ca7a58

Please sign in to comment.