Skip to content

Support GITHUB_TOKEN var for git-fork and git-pull-request#1177

Merged
hyperupcall merged 3 commits intotj:mainfrom
nim65s:main
Nov 16, 2024
Merged

Support GITHUB_TOKEN var for git-fork and git-pull-request#1177
hyperupcall merged 3 commits intotj:mainfrom
nim65s:main

Conversation

@nim65s
Copy link
Copy Markdown
Contributor

@nim65s nim65s commented Nov 13, 2024

Hi,

git-fork & git-pull-request currently require to set github token in git config global file.
I would like to keep this file versionned and public on github, so I would prefer not having to put secrets inside.

A common solution to this issue is to pass that token through the GITHUB_TOKEN environment variable instead.

Here is a simple commit implementing and documenting that.

ref. #839

Comment thread bin/git-fork Outdated
Comment thread bin/git-fork Outdated
Comment thread man/git-fork.md
@nim65s
Copy link
Copy Markdown
Contributor Author

nim65s commented Nov 14, 2024

Thanks for the review !
I've added the requested changes

Copy link
Copy Markdown
Collaborator

@hyperupcall hyperupcall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support this GITHUB_TOKEN feature! I just had a few notes¶

Comment thread bin/git-fork Outdated
Comment thread bin/git-pull-request Outdated
Comment thread bin/git-fork Outdated
@nim65s
Copy link
Copy Markdown
Contributor Author

nim65s commented Nov 14, 2024

@hyperupcall what would you think about dropping that switch, and using only one

github_personal_access_token=$(git config --default "${GITHUB_TOKEN}" git-extras.github-personal-access-token)

?

@hyperupcall
Copy link
Copy Markdown
Collaborator

@nim65s That's perfect!

Comment thread man/git-pull-request.md
@hyperupcall
Copy link
Copy Markdown
Collaborator

Great, thanks!

@hyperupcall hyperupcall merged commit d291b27 into tj:main Nov 16, 2024
@hyperupcall hyperupcall changed the title Allow use of GITHUB_TOKEN env var Support GITHUB_TOKEN var for git-fork and git-pull-request Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants