Merge pull request #3817 from MikeMcQuaid/gist-logs-require-credentials

gist-logs: require API credentials.
This commit is contained in:
Mike McQuaid 2018-02-19 19:27:05 +00:00 committed by GitHub
commit c216eff44f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,16 @@ module Homebrew
files["00.tap.out"] = { content: tap } files["00.tap.out"] = { content: tap }
end end
if GitHub.api_credentials_type == :none
puts <<~EOS
You can create a new personal access token:
#{GitHub::ALL_SCOPES_URL}
and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method.
EOS
login!
end
# Description formatted to work well as page title when viewing gist # Description formatted to work well as page title when viewing gist
if f.core_formula? if f.core_formula?
descr = "#{f.name} on #{OS_VERSION} - Homebrew build logs" descr = "#{f.name} on #{OS_VERSION} - Homebrew build logs"
@ -48,16 +58,6 @@ module Homebrew
url = create_gist(files, descr) url = create_gist(files, descr)
if ARGV.include?("--new-issue") || ARGV.switch?("n") if ARGV.include?("--new-issue") || ARGV.switch?("n")
if GitHub.api_credentials_type == :none
puts <<~EOS
You can create a new personal access token:
#{GitHub::ALL_SCOPES_URL}
and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method.
EOS
login!
end
url = create_issue(f.tap, "#{f.name} failed to build on #{MacOS.full_version}", url) url = create_issue(f.tap, "#{f.name} failed to build on #{MacOS.full_version}", url)
end end