Created
February 7, 2022 22:14
-
-
Save philip-gai/8b9b03446bed634413a0fd86045fbdd2 to your computer and use it in GitHub Desktop.
Update GITHUB_TOKEN in Codespace to work for multiple repositories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You have to unset the GITHUB_TOKEN, otherwise gh cli will use it and skip auth | |
unset GITHUB_TOKEN | |
# List of scopes: https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes | |
gh auth login --hostname 'github.com' --scopes 'read:org,repo,read:packages' | |
token="$(gh config get -h github.com oauth_token)" | |
export GITHUB_TOKEN="$token" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment