Skip to content

feat: sign in with an existing GitHub CLI login - #3316

Open
fmguerreiro wants to merge 2 commits into
gitify-app:mainfrom
fmguerreiro:feat/github-cli-login
Open

fmguerreiro wants to merge 2 commits into
gitify-app:mainfrom
fmguerreiro:feat/github-cli-login

Conversation

@fmguerreiro

@fmguerreiro fmguerreiro commented Sep 16, 2026

Copy link
Copy Markdown

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 token holds — including one gh takes from GH_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 by gh auth login or gh auth refresh needs no re-login. The account row persists no credential.

Gitify cannot widen the scopes gh issues, so these accounts are judged on notification access (notifications or repo), not PAT scope names. The scopes page cannot widen them either, so it points at gh auth refresh -s notifications.

Login screen CLI sign-in
new GitHub CLI entry hostname only, no token field
login cli

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.
@github-actions github-actions Bot added the enhancement New feature or enhancement to existing functionality label Sep 16, 2026
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
fmguerreiro marked this pull request as ready for review September 16, 2026 08:02
@setchy setchy added the forge:github GitHub Cloud, GitHub Enterprise label Sep 16, 2026
@github-actions github-actions Bot added dependency Dependency updates and removed forge:github GitHub Cloud, GitHub Enterprise labels Sep 17, 2026
@github-actions github-actions Bot removed the dependency Dependency updates label Sep 18, 2026
@fmguerreiro

Copy link
Copy Markdown
Author

rebased this down to just the cli login. the two perf commits moved out to #3319 and #3320.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or enhancement to existing functionality

Development

Successfully merging this pull request may close these issues.

2 participants