feat: sign in with an existing GitHub CLI login - #3316
Open
fmguerreiro wants to merge 2 commits into
Open
fmguerreiro wants to merge 2 commits into
fmguerreiro wants to merge 2 commits into
Conversation
Orgs that forbid classic PATs and refuse third-party OAuth app approval leave no working sign-in path, but the GitHub CLI's own OAuth app is often already authorized. Read that token from `gh auth token` at request time so the CLI stays its owner, rotation needs no re-login, and Gitify persists no copy.
An exported GH_TOKEN can be the only credential gh has, so dropping it from the spawn environment broke sign-in for those users. It also means the token may be any PAT, which keeps the narrower scope tiers reachable.
fmguerreiro
marked this pull request as ready for review
September 16, 2026 08:02
fmguerreiro
force-pushed
the
feat/github-cli-login
branch
from
September 18, 2026 01:26
2d1e859 to
4941319
Compare
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some orgs forbid classic PATs and will not approve third-party OAuth apps, leaving Gitify no working sign-in. The GitHub CLI's OAuth app is often already authorized there, so this reuses the token
gh auth tokenholds — including oneghtakes fromGH_TOKEN, which for some users is its only credential.The CLI stays the owner: every Octokit request resolves the token from
gh, and re-reads it once on a 401, so rotation bygh auth loginorgh auth refreshneeds no re-login. The account row persists no credential.Gitify cannot widen the scopes
ghissues, so these accounts are judged on notification access (notificationsorrepo), not PAT scope names. The scopes page cannot widen them either, so it points atgh auth refresh -s notifications.