Merge pull request #7275 from MikeMcQuaid/github_token
Set HOMEBREW_GITHUB_API_TOKEN from GITHUB_TOKEN.
This commit is contained in:
commit
0c78d65b3c
@ -131,6 +131,7 @@ module Homebrew
|
|||||||
"GitHub will allow you a greater number of API requests. For more information, see: " \
|
"GitHub will allow you a greater number of API requests. For more information, see: " \
|
||||||
"<https://developer.github.com/v3/#rate-limiting>\n\n *Note:* Homebrew doesn't " \
|
"<https://developer.github.com/v3/#rate-limiting>\n\n *Note:* Homebrew doesn't " \
|
||||||
"require permissions for any of the scopes.",
|
"require permissions for any of the scopes.",
|
||||||
|
default_text: "`$GITHUB_TOKEN`.",
|
||||||
},
|
},
|
||||||
HOMEBREW_GITHUB_API_USERNAME: {
|
HOMEBREW_GITHUB_API_USERNAME: {
|
||||||
description: "GitHub username for authentication with the GitHub API, used by Homebrew for features " \
|
description: "GitHub username for authentication with the GitHub API, used by Homebrew for features " \
|
||||||
|
|||||||
6
bin/brew
6
bin/brew
@ -79,6 +79,12 @@ then
|
|||||||
export HOMEBREW_EDITOR="$VISUAL"
|
export HOMEBREW_EDITOR="$VISUAL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Use GITHUB_TOKEN if HOMEBREW_GITHUB_API_TOKEN is unset.
|
||||||
|
if [[ -z "$HOMEBREW_GITHUB_API_TOKEN" && -n "$GITHUB_TOKEN" ]]
|
||||||
|
then
|
||||||
|
export HOMEBREW_GITHUB_API_TOKEN="$GITHUB_TOKEN"
|
||||||
|
fi
|
||||||
|
|
||||||
# Set CI variable for GitHub Actions, Azure Pipelines, Jenkins
|
# Set CI variable for GitHub Actions, Azure Pipelines, Jenkins
|
||||||
# (Set by default on Circle and Travis CI)
|
# (Set by default on Circle and Travis CI)
|
||||||
if [[ -n "$GITHUB_ACTIONS" || -n "$TF_BUILD" || -n "$JENKINS_HOME" ]]
|
if [[ -n "$GITHUB_ACTIONS" || -n "$TF_BUILD" || -n "$JENKINS_HOME" ]]
|
||||||
|
|||||||
@ -1282,6 +1282,8 @@ Note that environment variables must have a value set to be detected. For exampl
|
|||||||
|
|
||||||
*Note:* Homebrew doesn't require permissions for any of the scopes.
|
*Note:* Homebrew doesn't require permissions for any of the scopes.
|
||||||
|
|
||||||
|
*Default:* `$GITHUB_TOKEN`.
|
||||||
|
|
||||||
* `HOMEBREW_GITHUB_API_USERNAME`:
|
* `HOMEBREW_GITHUB_API_USERNAME`:
|
||||||
GitHub username for authentication with the GitHub API, used by Homebrew for features such as `brew search`. We strongly recommend using `HOMEBREW_GITHUB_API_TOKEN` instead.
|
GitHub username for authentication with the GitHub API, used by Homebrew for features such as `brew search`. We strongly recommend using `HOMEBREW_GITHUB_API_TOKEN` instead.
|
||||||
|
|
||||||
|
|||||||
@ -1637,6 +1637,9 @@ A personal access token for the GitHub API, used by Homebrew for features such a
|
|||||||
.IP
|
.IP
|
||||||
\fINote:\fR Homebrew doesn\'t require permissions for any of the scopes\.
|
\fINote:\fR Homebrew doesn\'t require permissions for any of the scopes\.
|
||||||
.
|
.
|
||||||
|
.IP
|
||||||
|
\fIDefault:\fR \fB$GITHUB_TOKEN\fR\.
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
\fBHOMEBREW_GITHUB_API_USERNAME\fR
|
\fBHOMEBREW_GITHUB_API_USERNAME\fR
|
||||||
GitHub username for authentication with the GitHub API, used by Homebrew for features such as \fBbrew search\fR\. We strongly recommend using \fBHOMEBREW_GITHUB_API_TOKEN\fR instead\.
|
GitHub username for authentication with the GitHub API, used by Homebrew for features such as \fBbrew search\fR\. We strongly recommend using \fBHOMEBREW_GITHUB_API_TOKEN\fR instead\.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user