Add advice about keychain credentials
Fixes Homebrew/homebrew#50050. Closes Homebrew/homebrew#50059.
This commit is contained in:
parent
f30221c7e1
commit
8aaa95ee99
@ -487,7 +487,7 @@ module GitHub
|
|||||||
GitHub #{error}
|
GitHub #{error}
|
||||||
Try again in #{pretty_ratelimit_reset(reset)}, or create a personal access token:
|
Try again in #{pretty_ratelimit_reset(reset)}, or create a personal access token:
|
||||||
#{Tty.em}https://github.com/settings/tokens/new?scopes=&description=Homebrew#{Tty.reset}
|
#{Tty.em}https://github.com/settings/tokens/new?scopes=&description=Homebrew#{Tty.reset}
|
||||||
and then set the token as: HOMEBREW_GITHUB_API_TOKEN
|
and then set the token as: export HOMEBREW_GITHUB_API_TOKEN="your_new_token"
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -498,11 +498,20 @@ module GitHub
|
|||||||
|
|
||||||
class AuthenticationFailedError < Error
|
class AuthenticationFailedError < Error
|
||||||
def initialize(error)
|
def initialize(error)
|
||||||
super <<-EOS.undent
|
message = "GitHub #{error}\n"
|
||||||
GitHub #{error}
|
if ENV["HOMEBREW_GITHUB_API_TOKEN"]
|
||||||
HOMEBREW_GITHUB_API_TOKEN may be invalid or expired, check:
|
message << <<-EOS.undent
|
||||||
|
HOMEBREW_GITHUB_API_TOKEN may be invalid or expired; check:
|
||||||
#{Tty.em}https://github.com/settings/tokens#{Tty.reset}
|
#{Tty.em}https://github.com/settings/tokens#{Tty.reset}
|
||||||
EOS
|
EOS
|
||||||
|
else
|
||||||
|
message << <<-EOS.undent
|
||||||
|
The GitHub credentials in the OS X keychain are invalid.
|
||||||
|
Clear them with:
|
||||||
|
printf "protocol=https\\nhost=github.com\\n" | git credential-osxkeychain erase
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
super message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user