mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Support GITHUB_TOKEN var for git-fork and git-pull-request (#1177)
Co-authored-by: 罗泽轩 <4161644+spacewander@users.noreply.github.com>
This commit is contained in:
parent
fb0bc6950b
commit
d291b2775c
|
|
@ -17,9 +17,9 @@ read -r user
|
|||
# personal access token
|
||||
# config name is github-personal-access-token '_' is not allowed in git config
|
||||
|
||||
github_personal_access_token=$(git config git-extras.github-personal-access-token)
|
||||
github_personal_access_token=$(git config --default "$GITHUB_TOKEN" git-extras.github-personal-access-token)
|
||||
|
||||
test -z "$github_personal_access_token" && abort "git config git-extras.github-personal-access-token required"
|
||||
test -z "$github_personal_access_token" && abort "GITHUB_TOKEN, or git config git-extras.github-personal-access-token required"
|
||||
|
||||
# extract owner + project from repo url
|
||||
project=${url##*/}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ EOF
|
|||
# personal access token
|
||||
# config name is github-personal-access-token '_' is not allowed in git config
|
||||
|
||||
github_personal_access_token=$(git config git-extras.github-personal-access-token)
|
||||
github_personal_access_token=$(git config --default "$GITHUB_TOKEN" git-extras.github-personal-access-token)
|
||||
|
||||
test -z "$github_personal_access_token" && abort "git config git-extras.github-personal-access-token required"
|
||||
test -z "$github_personal_access_token" && abort "GITHUB_TOKEN or git config git-extras.github-personal-access-token required"
|
||||
|
||||
# branch
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ A personal access token is required for making the API call to create a new fork
|
|||
Make sure the personal access token has the right \fBOAuth\fR scopes for the repo(s)
|
||||
.
|
||||
.P
|
||||
Use \fBgit config \-\-global \-\-add git\-extras\.github\-personal\-access\-token <your\-personal\-access\-token>\fR
|
||||
Use \fBGITHUB_TOKEN\fR environment variable, or \fBgit config \-\-global \-\-add git\-extras\.github\-personal\-access\-token <your\-personal\-access\-token>\fR
|
||||
.
|
||||
.P
|
||||
If using multiple accounts, override the global value in the specific repo using \fBgit config git\-extras\.github\-personal\-access\-token <other\-acc\-personal\-access\-token>\fR
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@
|
|||
|
||||
<p>Make sure the personal access token has the right <code>OAuth</code> scopes for the repo(s)</p>
|
||||
|
||||
<p>Use <code>git config --global --add git-extras.github-personal-access-token <your-personal-access-token></code></p>
|
||||
<p>Use <code>GITHUB_TOKEN</code> environment variable, or <code>git config --global --add git-extras.github-personal-access-token <your-personal-access-token></code></p>
|
||||
|
||||
<p>If using multiple accounts, override the global value in the specific repo using <code>git config git-extras.github-personal-access-token <other-acc-personal-access-token></code></p>
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ git-fork(1) -- Fork a repo on github
|
|||
|
||||
Make sure the personal access token has the right `OAuth` scopes for the repo(s)
|
||||
|
||||
Use `git config --global --add git-extras.github-personal-access-token <your-personal-access-token>`
|
||||
Use `GITHUB_TOKEN` environment variable, or `git config --global --add git-extras.github-personal-access-token <your-personal-access-token>`
|
||||
|
||||
If using multiple accounts, override the global value in the specific repo using `git config git-extras.github-personal-access-token <other-acc-personal-access-token>`
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ A personal access token is required for making the API call to open the pull req
|
|||
Make sure the personal access token has the right \fBOAuth\fR scopes for the repo(s)
|
||||
.
|
||||
.P
|
||||
Use \fBgit config \-\-global \-\-add git\-extras\.github\-personal\-access\-token <your\-personal\-access\-token>\fR
|
||||
Use \fBGITHUB_TOKEN\fR environment variable, or \fBgit config \-\-global \-\-add git\-extras\.github\-personal\-access\-token <your\-personal\-access\-token>\fR
|
||||
.
|
||||
.P
|
||||
If using multiple accounts, override the global value in the specific repo using \fBgit config git\-extras\.github\-personal\-access\-token <other\-acc\-personal\-access\-token>\fR
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
<p>Make sure the personal access token has the right <code>OAuth</code> scopes for the repo(s)</p>
|
||||
|
||||
<p>Use <code>git config --global --add git-extras.github-personal-access-token <your-personal-access-token></code></p>
|
||||
<p>Use <code>GITHUB_TOKEN</code> environment variable, or <code>git config --global --add git-extras.github-personal-access-token <your-personal-access-token></code></p>
|
||||
|
||||
<p>If using multiple accounts, override the global value in the specific repo using <code>git config git-extras.github-personal-access-token <other-acc-personal-access-token></code></p>
|
||||
|
||||
|
|
@ -104,9 +104,9 @@ Everything up-to-date
|
|||
create pull-request for spacewander/spacewander-toolbox 'master'
|
||||
|
||||
title: test
|
||||
body:
|
||||
base [master]:
|
||||
GitHub two-factor authentication code (leave blank if not set up):
|
||||
body:
|
||||
base [master]:
|
||||
GitHub two-factor authentication code (leave blank if not set up):
|
||||
|
||||
...
|
||||
</code></pre>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ A personal access token is required for making the API call to open the pull req
|
|||
|
||||
Make sure the personal access token has the right `OAuth` scopes for the repo(s)
|
||||
|
||||
Use `git config --global --add git-extras.github-personal-access-token <your-personal-access-token>`
|
||||
Use `GITHUB_TOKEN` environment variable, or `git config --global --add git-extras.github-personal-access-token <your-personal-access-token>`
|
||||
|
||||
If using multiple accounts, override the global value in the specific repo using `git config git-extras.github-personal-access-token <other-acc-personal-access-token>`
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue