Skip to content

Commit

Permalink
use GITHUB_TOKEN: follow review advices
Browse files Browse the repository at this point in the history
Co-authored-by: 罗泽轩 <[email protected]>
  • Loading branch information
nim65s and spacewander committed Nov 14, 2024
1 parent efbf3e5 commit 3be2e21
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
6 changes: 1 addition & 5 deletions bin/git-fork
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ read -r user
# personal access token
# config name is github-personal-access-token '_' is not allowed in git config

if test -z "${GITHUB_TOKEN}"; then
github_personal_access_token=$(git config git-extras.github-personal-access-token)
else
github_personal_access_token=$GITHUB_TOKEN
fi
github_personal_access_token=$(git config --default "$GITHUB_TOKEN" git-extras.github-personal-access-token)

test -z "$github_personal_access_token" && abort "GITHUB_TOKEN, or git config git-extras.github-personal-access-token required"

Expand Down
6 changes: 1 addition & 5 deletions bin/git-pull-request
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ EOF
# personal access token
# config name is github-personal-access-token '_' is not allowed in git config

if test -z "${GITHUB_TOKEN}"; then
github_personal_access_token=$(git config git-extras.github-personal-access-token)
else
github_personal_access_token=$GITHUB_TOKEN
fi
github_personal_access_token=$(git config --default "$GITHUB_TOKEN" git-extras.github-personal-access-token)

test -z "$github_personal_access_token" && abort "GITHUB_TOKEN or git config git-extras.github-personal-access-token required"

Expand Down
2 changes: 1 addition & 1 deletion man/git-fork.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3be2e21

Please sign in to comment.