You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(kiloclaw): add GitHub machine user to secret catalog (#1074)
<!-- PR title format: type(scope): description — e.g., feat(auth): add
SSO login -->
<!-- Keep the title under 72 characters, use imperative mood, no
trailing period. -->
## Summary
- Add GitHub as a tool-category entry in the secret catalog with three
fields: Username, Email, and Personal Access Token
- Users can enter GitHub credentials directly in the Settings tab under
a new "Tools" section
- Boot script (`start-openclaw.sh`) configures `gh` CLI auth and `git`
identity on machine startup, and cleans up credentials on removal
- Inline security note recommends using a dedicated GitHub account with
a minimally-scoped fine-grained PAT
## Verification
## Validation
- **Username**: alphanumeric + hyphens, no leading/trailing/consecutive
hyphens (GitHub rules)
- **Email**: basic email format (`user@domain.tld`)
- **PAT**: classic (`ghp_`) or fine-grained (`github_pat_`) prefixes
only; OAuth/Actions tokens rejected with clear message
## Test plan
[x] `pnpm typecheck` — clean
[x] `pnpm lint` — clean
[x] `pnpm run format:check` — clean
[x] `pnpm --filter @kilocode/kiloclaw-secret-catalog test` — 54 tests
pass
[x] `pnpm --filter kiloclaw test` — 596 tests pass
[x] Manual: spun up a KiloClaw instance, configured GitHub credentials
(username: `kiloclaw-bot`, email: `kiloclaw-bot@example.com`, PAT:
fine-grained token), redeployed, verified `gh auth status` and `git
config --global user.name/email` set correctly on the machine
[x] Manual: removed GitHub credentials, redeployed, verified `gh auth
status` shows logged out and git identity cleared
## Visual Changes
- New **Tools** section appears between Channels and Google Account in
Settings tab
- GitHub entry shows Username, Email, and PAT fields with per-field
validation
- Shield icon + inline security note on the Save button row: recommends
dedicated account + scoped PAT with links to GitHub docs
- `helpText` below entry links to GitHub token settings
## Reviewer Notes
- **No OpenClaw config patching needed** — unlike channels
(Telegram/Discord/Slack) which are OpenClaw plugins requiring
`openclaw.json` patches, GitHub is system-level tooling. The boot script
configures `gh` CLI and `git` identity; the agent uses them via exec.
- **Credential cleanup on removal** — the `else` branch in
start-openclaw.sh runs `gh auth logout` and unsets git config so
removing credentials actually de-authenticates the machine (persistent
volume would otherwise retain stale creds).
- **`allFieldsRequired: true`** — intentional for the machine user use
case (committing code needs all three). A future read-only token-only
entry would be a separate catalog item.
- **`actionRowExtra` prop** — generic slot on `SecretEntrySection` for
injecting content on the button row. Currently only used for GitHub's
security note but available for future tool entries.
<!-- Optional: reviewer focus areas, edge cases, or context that helps
review quickly. -->
0 commit comments