Repository navigation
fix(tools): project gh credentials into confined GitHub spawns - #411
Merged
Merged
Conversation
gh pr create failed in the sandbox with HTTP 401 / "token is invalid" even after host(**.github.com) was granted. The proxy could reach api.github.com; the OS keychain could not be opened, so gh looked unauthenticated. A GitHub host grant now projects the host `gh` token into that spawn and isolates GH_CONFIG_DIR so the CLI does not also try the blocked keychain account. gh / git push may write .git for that spawn only; ordinary commands keep the carve-out. This is a publish capability, not an unsandbox.
gh pr create could authenticate via the projected token but still aborted: the workspace remote is [email protected], and SSH cannot use the CONNECT proxy. The same GitHub host grant now writes a spawn-local gitconfig that insteadOf-rewrites SSH remotes to https://github.com/ and authenticates with GH_TOKEN, so push stays confined.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
* fix(tools): project gh credentials into confined GitHub spawns gh pr create failed in the sandbox with HTTP 401 / "token is invalid" even after host(**.github.com) was granted. The proxy could reach api.github.com; the OS keychain could not be opened, so gh looked unauthenticated. A GitHub host grant now projects the host `gh` token into that spawn and isolates GH_CONFIG_DIR so the CLI does not also try the blocked keychain account. gh / git push may write .git for that spawn only; ordinary commands keep the carve-out. This is a publish capability, not an unsandbox. * fix(tools): rewrite SSH GitHub remotes to HTTPS in confined spawns gh pr create could authenticate via the projected token but still aborted: the workspace remote is [email protected], and SSH cannot use the CONNECT proxy. The same GitHub host grant now writes a spawn-local gitconfig that insteadOf-rewrites SSH remotes to https://github.com/ and authenticates with GH_TOKEN, so push stays confined.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
* fix(tools): project gh credentials into confined GitHub spawns gh pr create failed in the sandbox with HTTP 401 / "token is invalid" even after host(**.github.com) was granted. The proxy could reach api.github.com; the OS keychain could not be opened, so gh looked unauthenticated. A GitHub host grant now projects the host `gh` token into that spawn and isolates GH_CONFIG_DIR so the CLI does not also try the blocked keychain account. gh / git push may write .git for that spawn only; ordinary commands keep the carve-out. This is a publish capability, not an unsandbox. * fix(tools): rewrite SSH GitHub remotes to HTTPS in confined spawns gh pr create could authenticate via the projected token but still aborted: the workspace remote is [email protected], and SSH cannot use the CONNECT proxy. The same GitHub host grant now writes a spawn-local gitconfig that insteadOf-rewrites SSH remotes to https://github.com/ and authenticates with GH_TOKEN, so push stays confined.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
* fix(tools): project gh credentials into confined GitHub spawns gh pr create failed in the sandbox with HTTP 401 / "token is invalid" even after host(**.github.com) was granted. The proxy could reach api.github.com; the OS keychain could not be opened, so gh looked unauthenticated. A GitHub host grant now projects the host `gh` token into that spawn and isolates GH_CONFIG_DIR so the CLI does not also try the blocked keychain account. gh / git push may write .git for that spawn only; ordinary commands keep the carve-out. This is a publish capability, not an unsandbox. * fix(tools): rewrite SSH GitHub remotes to HTTPS in confined spawns gh pr create could authenticate via the projected token but still aborted: the workspace remote is [email protected], and SSH cannot use the CONNECT proxy. The same GitHub host grant now writes a spawn-local gitconfig that insteadOf-rewrites SSH remotes to https://github.com/ and authenticates with GH_TOKEN, so push stays confined.
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.
Projects host gh identity into confined gh/git push spawns and rewrites SSH GitHub remotes to HTTPS so gh pr create works without unsandboxing.