fix: prefer root secret sources from tool worktrees (#732)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -6505,10 +6505,14 @@ function readLocalPostgresPasswordMaterial(input: { sourceRef: string; sourceKey
|
||||
}
|
||||
|
||||
function localSecretSourcePaths(sourceRef: string): string[] {
|
||||
const paths = [join(repoRoot, ".state", "secrets", sourceRef)];
|
||||
const marker = "/.worktree/";
|
||||
const index = repoRoot.indexOf(marker);
|
||||
if (index >= 0) paths.push(join(repoRoot.slice(0, index), ".state", "secrets", sourceRef));
|
||||
const paths = index >= 0
|
||||
? [
|
||||
join(repoRoot.slice(0, index), ".state", "secrets", sourceRef),
|
||||
join(repoRoot, ".state", "secrets", sourceRef),
|
||||
]
|
||||
: [join(repoRoot, ".state", "secrets", sourceRef)];
|
||||
return [...new Set(paths)];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user