Repository navigation
Refresh gh login from the Git credential store - #40
Merged
Merged
Conversation
Owner
Author
|
Validation complete for 6cbbfe1: all eight CI jobs passed (plus Dependabot validation): https://github.com/akan72/dotfiles/actions/runs/34261417566. Real PAT refresh on the Mac mini succeeded with output suppressed; independent gh API calls using $HOME/.config/gh authenticated as akan72 and accessed akan72/dotfiles. Synthetic regression tests passed locally and on the mini. Full commands and scope are documented in the Test Plan. PR is left open for merge. |
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.
Summary
$HOME/.config/gh, outside the dotfiles checkout. SetGH_CONFIG_DIRin shared bash/zsh configuration and in the refresh script itself so direct SSH invocation selects the same location.Test Plan
sh tests/gh-auth-refresh.shfail before the fix because the refresh subprocess had noGH_CONFIG_DIR; it passes after the fix locally and on the Mac mini.shared.shunder bash and zsh. It verifies the external config path and that no checkout-local gh directory is created.bash -n bashrc shared.sh scripts/gh-auth-refresh.sh tests/gh-auth-refresh.sh,git diff --check, andpre-commit run --all-files: passed.GH_TOKENandGITHUB_TOKENunset,XDG_CONFIG_HOME="$HOME/dotfiles", and script output suppressed. Exit status was zero. No PAT was displayed or copied to this host.GH_CONFIG_DIR="$HOME/.config/gh" gh api user --jq .loginandgh repo view akan72/dotfiles --json nameWithOwner --jq .nameWithOwner, again with token environment overrides unset: returnedakan72andakan72/dotfiles./tmp/dotfiles-pr40.uDmh1V. This host's live configuration was not changed. Old repository-local gh configuration was not deleted.