mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-07-27 22:38:30 +08:00
fix: dereference symlinks when snapshotting sensitive paths to .claude-pr/ (#1186)
`cpSync` defaults to `dereference: false`, which means it tries to recreate symlinks at the destination rather than copying file contents. When a sensitive path (e.g. CLAUDE.md) is a symlink, this fails with `ENOENT: no such file or directory, symlink` because `cpSync` attempts to call `symlink()` without ensuring the parent `.claude-pr/` directory exists first. Adding `dereference: true` fixes this by following symlinks and copying the actual file contents, which is also the correct semantic behavior — review agents need to inspect the real content, not a symlink that may not resolve correctly from `.claude-pr/`. Fixes the action crash when repositories use symlinked CLAUDE.md (e.g. CLAUDE.md -> AGENTS.md).
This commit is contained in:
parent
bf6d40e068
commit
f4d6a11de1
@ -54,7 +54,7 @@ export function restoreConfigFromBase(baseBranch: string): void {
|
||||
rmSync(".claude-pr", { recursive: true, force: true });
|
||||
for (const p of SENSITIVE_PATHS) {
|
||||
if (existsSync(p)) {
|
||||
cpSync(p, `.claude-pr/${p}`, { recursive: true });
|
||||
cpSync(p, `.claude-pr/${p}`, { recursive: true, dereference: true });
|
||||
}
|
||||
}
|
||||
if (existsSync(".claude-pr")) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user