utils/github: Use constant everywhere for "create a PAT" message

- This way if we ever change this messaging, we only have to do so once.
This commit is contained in:
Issy Long 2021-02-05 12:34:11 +00:00
parent ccb6d5e834
commit 9394fe2b52
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -49,9 +49,8 @@ module GitHub
@github_message = github_message
super <<~EOS
GitHub API Error: #{github_message}
Try again in #{pretty_ratelimit_reset(reset)}, or create a personal access token:
#{ALL_SCOPES_URL}
#{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")}
Try again in #{pretty_ratelimit_reset(reset)}, or:
#{CREATE_GITHUB_PAT_MESSAGE}
EOS
end
@ -75,9 +74,7 @@ module GitHub
The GitHub credentials in the macOS keychain may be invalid.
Clear them with:
printf "protocol=https\\nhost=github.com\\n" | git credential-osxkeychain erase
Or create a personal access token:
#{ALL_SCOPES_URL}
#{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")}
#{CREATE_GITHUB_PAT_MESSAGE}
EOS
end
super message.freeze
@ -182,9 +179,7 @@ module GitHub
Your #{what} credentials do not have sufficient scope!
Scopes required: #{needed_scopes}
Scopes present: #{credentials_scopes}
Create a personal access token:
#{ALL_SCOPES_URL}
#{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")}
#{CREATE_GITHUB_PAT_MESSAGE}
EOS
end