Not detecting Github Authentication
OS: Ubuntu 24.04.3 LTS x86_64
Installed with pipx install git+https://github.com/Matars/gitfetch
❯ gh auth status
github.com
✓ Logged in to github.com account Chinychon (keyring)
- Active account: true
- Git operations protocol: https
- Token: gho_************************************
- Token scopes: 'gist', 'read:org', 'repo', 'workflow'
❯ gitfetch
🚀 Welcome to gitfetch! Let's set up your configuration.
Choose your git provider:
● GitHub
○ GitLab
○ Gitea/Forgejo/Codeberg
○ Sourcehut
Use ↑/↓ arrows, ● = selected, Enter to confirm
Could not get authenticated user: Failed to get auth status
Please authenticate with: gh auth login
Error: Initialization failed
Could you let me know if this is still happening on latest release (v1.1.7)
https://github.com/Matars/gitfetch/releases/tag/v1.1.7
Same here. I checked out main and v1.1.7, same issue. Even gh auth login challenge succeeded and gh status is fine gitfetch complains it could not get authenticated user.
Yes I am on the latest version. It works when I manually configure the [DEFAULT] section in gitfetch.conf
As @Chinychon mentioned, configuring manually the authentication works. So I missed the provider settings, because this wasn't differentiated before. But, I also moved the config file to let gitfetch create a fresh one and this didn't work out. The config file has not been created again.
Happens for me too looks like gh auth status --json hosts (the command used to find authenticated user) does not exist for me, triggering the error.
We could maybe try loading the ~/.config/gh/hosts.yml and find it that way?
Or use my previously proposed fix to use regex on gh auth status if everything else fails
Need to figure out though if ~/.config/gh/hosts.yml exists on every platform
Made pull request to add simple fix #25
Happy waking up to this, thank you