Repository navigation
Closed
Labels
effort/mediumEffort Mediumpriority/p2-mediumPriority P2: standard worksource/agentFiled by an agenttype/refactorType refactor: a new structure, same behaviorvalue/mediumValue Medium
Description
Problem
A git child of devops-cli gets its GitHub credential in three different ways:
_github_pin(src/devops_cli/core/process.py) givesGH_TOKENto each git child that reaches a remote.- Some callers add
-c credential.https://github.com.helper=…(CONST_GIT_GITHUB_CREDENTIAL_CONFIG:infra/repo_tree.py,k8s/argocd_overrides.py). - Since fix(repos): Give git children the session credential #6479, the process runner inserts the same two
-cvalues into the argument list of each network git call (git_credential_args).
The second and third ways exist only because build_subprocess_env drops the ambient GIT_CONFIG_COUNT, GIT_CONFIG_KEY_n and GIT_CONFIG_VALUE_n. The devcontainer sets the GitHub credential helper through these variables (.devcontainer/image/devcontainer.json), so git does not find it. A probe in the devcontainer showed that a git child gets none of the 9 GIT_CONFIG_* keys of the shell. The runner image sets the same helper in the system config, so the Jobs do not need the variables.
Change
- On the person path (devops-cli does not act as the GitHub App),
build_subprocess_envpasses the ambientGIT_CONFIG_COUNT,GIT_CONFIG_KEY_nandGIT_CONFIG_VALUE_nto git children, as a shell does. - When devops-cli acts as the GitHub App (runner Jobs and the Service), it passes none of them. Until feat(roadmap): add the three-container runner Job, policy and log reads #3700, a process that the agent shell starts could otherwise give agent-set values to a git child that holds the token.
- A caller still cannot set a code-loading
GIT_*key. - Delete
git_credential_argsand its argument rewrite (fix(repos): Give git children the session credential #6479), and the per-callCONST_GIT_GITHUB_CREDENTIAL_CONFIGvalues. Keep the read of origin before the destructive step ofworktrees add(PreReadOrigin).
Acceptance criteria
- In the devcontainer,
devops repos worktrees addon a private repository reads origin with the configured helper, with no-cvalue from devops-cli (fix(repos): worktrees add has no credential for a private repo #6340). - In App mode, a
GIT_CONFIG_*value in the environment does not reach a git child. - No code in
src/inserts credential-cvalues into a git argument list.
Decision
The owner approved this change on 2026-11-21, after an audit of the git use of devops-cli ("Proceed as recommended").
Related
- fix(repos): worktrees add has no credential for a private repo #6340 and fix(repos): Give git children the session credential #6479 (the argument rewrite), feat(roadmap): add the three-container runner Job, policy and log reads #3700 (the agent container gets no token).
Source
Source: #6340
Metadata
Metadata
Assignees
Labels
effort/mediumEffort Mediumpriority/p2-mediumPriority P2: standard worksource/agentFiled by an agenttype/refactorType refactor: a new structure, same behaviorvalue/mediumValue Medium
Activity
dan-petty commentedon Nov 21, 2026
core, and .github/labels.yml declares no scope/core label. Add the label to the file to give the scope to this item.Both touch how credentials reach git children in build_subprocess_env, but #5265 scopes which calls get the token while this candidate changes the passing mechanism from -c args to ambient GIT_CONFIG_* vars.devops-cli-service commentedon Nov 21, 2026
Released in v0.188.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.188.4
devops-cli-service commentedon Nov 21, 2026
Live since 2026-11-21 19:37 UTC