Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.
This repository was archived by the owner on Nov 4, 2022. It is now read-only.

Logged in user returns wrong value from git repo #648

@bpatram

Description

@bpatram

gh reports my current user incorrectly when called from a folder that is a git repo (I think that's what is triggering it?).

$ gh user --whoami
First we need authorization to use GitHub's API. Login with your GitHub account.
? Enter your GitHub user bpatram
? Enter your GitHub password [hidden]
? Enter your two-factor code 851335
Writing GH config data: /Users/brandonpatram/.gh.json
Authentication succeed.
ebth

# Calling this from a repo
$ gh user --whoami
ebth

# Moving to a directory that is not a git repo
$ cd ~
$ gh user --whoami
bpatram

In my case, it seems to return the organization the repo is owned by (ebth). Interestingly enough my .gh.json does list the correct user.

    "github_user": "bpatram",

Deleting the .gh.json file and relogging has no effect.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions