Conversation
Refresh an expired or near-expiry refreshable token while reporting status, unless --no-refresh is given, and show whether the token is short-lived, when it expires, and whether it was just refreshed. Expose the refreshable and expiry fields through the JSON output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2dc3f23c-61a6-43a7-85cd-90aa872a7fc6
This was referenced Sep 15, 2026
babakks
added this pull request to stack #14457
September 15, 2026 01:31
This branch has not been deployed
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.
Part of #14449. Based on #14453 (auth token).
Description
Teaches
gh auth statusto show short-lived token details and to refresh the token as part of reporting status, so what it displays reflects a currently valid credential rather than a stale or expired one.How did you test this change?
This feature is verified end to end as a whole rather than per PR. End-to-end tests should pass.
Key points
gh auth token, the git credential helper). That means a short-lived token whose access token has expired is refreshed and reported as valid, rather than being surfaced as broken. Status reflects the credential gh would actually use, not a stale snapshot.gh auth statusconcurrently with another gh process cannot double-spend the refresh token.Notes for reviewers
Focus on the status output formatting for the refreshable case and the point where resolving status triggers a refresh. Confirm the non-refreshable path is unchanged.
Commit:
fix(auth status): show and refresh short-lived token detailsAuthorship and follow-up
Who wrote this:
Who answers review comments: