This uses the same function go-gh uses to find the users Github auth token when cloning repos.
Previously it was only looking for GITHUB_TOKEN.
This change will allow users to just run gh auth login to use the tool or it will work by supplying a github token via GH_TOKEN or GITHUB_TOKEN if gh is not installed
Testing
With out gh
Uninstall gh ( brew uninstall gh)
Make sure gh has not added anything to ~/.gitconfig look for something like
GH_TOKEN=<your github token> go run main.go release prepare gb <version> --no-tag
// or
GITHUB_TOKEN=<your gitub token> go run main.go release prepare gb <version> --no-tag
Verify that the changes can be pushed to github and that the PR is created
With gh installed
re-install gh
Try without logging in by repeating steps 5 and 6 above
Login in via gh auth login and make sure to not rungh auth setup-git
Verify that gh has not modified ~./gitconfig
Try creating a test release without the exported token: go run main.go release prepare gb <version> --no-tag
Verify that the changes can be pushed and that the PR is created
This uses the same function
go-gh
uses to find the users Github auth token when cloning repos. Previously it was only looking forGITHUB_TOKEN
. This change will allow users to just rungh auth login
to use the tool or it will work by supplying a github token viaGH_TOKEN
orGITHUB_TOKEN
ifgh
is not installedTesting
With out
gh
gh
(brew uninstall gh
)gh
has not added anything to~/.gitconfig
look for something like~/.config/gh/hosts.yml
does not have anoauth_token
go run main.go release prepare gb <version> --no-tag
With
gh
installedgh
gh auth login
and make sure to not rungh auth setup-git
gh
has not modified~./gitconfig
go run main.go release prepare gb <version> --no-tag