Skip to content

Persist GitHub CLI account selection#31

Merged
PabloZaiden merged 2 commits into
mainfrom
chat-devbox-1-10c306fd
Jun 30, 2026
Merged

Persist GitHub CLI account selection#31
PabloZaiden merged 2 commits into
mainfrom
chat-devbox-1-10c306fd

Conversation

@PabloZaiden

Copy link
Copy Markdown
Owner

Summary

  • add --gh-user/--gh-host to pin GH_TOKEN injection to a specific gh account
  • persist githubAuth metadata in .devbox/state.json and expose it in status
  • document the account selection precedence for downstream tools

Validation

  • bun run build
  • bun run test:fast

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 30, 2026 14:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the ability to pin GH_TOKEN injection to a specific GitHub CLI (gh) account by introducing --gh-user/--gh-host, persisting the selected account metadata in .devbox/state.json, surfacing it in devbox status, and documenting the selection precedence.

Changes:

  • Add --gh-user / --gh-host parsing for up and rebuild, and persist the chosen { host, user } as githubAuth in workspace state.
  • Thread the persisted githubAuth preference through host environment resolution so gh auth token can target a specific account.
  • Extend status output, tests, and README docs to include/describe githubAuth.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/status.test.ts Updates status expectations to include githubAuth.
tests/runtime.test.ts Adds unit tests for buildGhCliTokenArgs.
tests/core.test.ts Adds coverage for arg parsing validation and persisted githubAuth loading.
tests/arise.test.ts Updates workspace state fixtures to include githubAuth.
src/status.ts Adds githubAuth to DevboxStatus and returns it from state.
src/runtime.ts Adds GithubAuthPreference plumbing + buildGhCliTokenArgs for targeted gh auth token.
src/core.ts Extends workspace state schema/migration to include githubAuth; adds CLI flag parsing.
src/cli.ts Resolves githubAuth preference from flags/env/state and persists it after up/rebuild.
README.md Documents flags, precedence, and status payload example including githubAuth.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cli.ts Outdated
Comment thread src/core.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PabloZaiden
PabloZaiden enabled auto-merge (squash) June 30, 2026 14:48
@PabloZaiden
PabloZaiden merged commit 488ea3a into main Jun 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants