Support GITHUB_TOKEN var for git-fork and git-pull-request (#1177)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled

Co-authored-by: 罗泽轩 <4161644+spacewander@users.noreply.github.com>
This commit is contained in:
Guilhem Saurel 2024-11-16 19:33:26 +01:00 committed by GitHub
parent fb0bc6950b
commit d291b2775c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 13 additions and 13 deletions

View file

@ -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##*/}

View file

@ -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

View file

@ -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

View file

@ -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 &lt;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 &lt;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 &lt;other-acc-personal-access-token></code></p>

View file

@ -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>`

View file

@ -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

View file

@ -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 &lt;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 &lt;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 &lt;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>

View file

@ -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>`