Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cli/go-gh
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.11.0
Choose a base ref
...
head repository: cli/go-gh
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.11.1
Choose a head ref
  • 4 commits
  • 2 files changed
  • 3 contributors

Commits on Oct 31, 2024

  1. Fix token exposure for non-gh hosts in codespaces

    This commit introduces a fix for `GITHUB_TOKEN` being exposed to non-github hosts while in a codespace. We no longer return the `GITHUB_TOKEN` for any host except github.com and github.localhost while in a codespace (while the env var `CODESPACES` is `true`).
    
    This commit also changes how tokens are returned when no oAuth token is found in a config. Previously, an empty string and the `oauthToken` source was returned. Now, we return an empty string and the `defaultSource` source. The intention behind this change is to make more logical sense by not returning an `oauthToken` source when we didn't get any token. It's also worth mentioning that this change also improves our test coverage - all lines in `tokenForHost` are now covered by tests, and we don't have unreachable code.
    
    Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
    williammartin and BagToad committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    5d6079f View commit details
    Browse the repository at this point in the history
  2. Refactor tokenForHost for readability

    Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
    williammartin and BagToad committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    5f282a5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6240e99 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2024

  1. Merge commit from fork

    Prevent `tokenForHost` from leaking `GITHUB_TOKEN` to non-GitHub host in Codespaces
    andyfeller authored Nov 27, 2024
    Configuration menu
    Copy the full SHA
    65bd8d7 View commit details
    Browse the repository at this point in the history
Loading