fix: dereference symlinks when snapshotting sensitive paths to .claude-pr/#1186
Open
matanbaruch wants to merge 1 commit intoanthropics:mainfrom
Open
fix: dereference symlinks when snapshotting sensitive paths to .claude-pr/#1186matanbaruch wants to merge 1 commit intoanthropics:mainfrom
matanbaruch wants to merge 1 commit intoanthropics:mainfrom
Conversation
…e-pr/ `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).
Author
|
cc @ashwin-ant @dicksontsai - this fixes a regression introduced in #1174. The |
4 tasks
forklady42
added a commit
to Quantum-Accelerators/electrai
that referenced
this pull request
Apr 7, 2026
## Summary - Pin `anthropics/claude-code-action` to `v1.0.88` in `.github/workflows/claude.yml` - Works around anthropics/claude-code-action#1187 — v1.0.89's `restoreConfigFromBase` crashes with `ENOENT: no such file or directory, symlink` because our `CLAUDE.md` is a symlink to `AGENTS.md` (from #91) - Every `@claude` trigger has failed since v1.0.89 went out on 2026-04-05; most recent failure: https://github.com/Quantum-Accelerators/electrai/actions/runs/24089849192 ## Why v1.0.88 - Last release before the regression (#1172 / #1174 landed in v1.0.89) - Upstream fix is anthropics/claude-code-action#1186 but it is still open; once that ships we can revert the pin back to `@v1` ## Test plan Note: `@claude`-ing this PR won't test the fix — `issue_comment` workflows are always resolved from the default branch, so the broken `@v1` on `main` would still run. The test has to happen post-merge. - [ ] Merge to `main` - [ ] Retrigger `@claude review once more` on #84 (it's already failing on v1.0.89) - [ ] Confirm the workflow run gets past `Restoring ... from origin/main (PR head is untrusted)` without an `ENOENT: no such file or directory, symlink` error - [ ] Once anthropics/claude-code-action#1186 ships, revert the pin back to `@v1`
davidpoblador
added a commit
to alltuner/vibetuner
that referenced
this pull request
Apr 8, 2026
…1613) ## Summary - Pins `anthropics/claude-code-action` to `v1.0.88` in both workflow files - v1.0.89 introduced a regression where `cpSync` with `dereference:false` fails on repos with symlinked `CLAUDE.md` (anthropics/claude-code-action#1187) - Applies to both `.github/workflows/claude-code-review.yml` and the template copy ## Test plan - [ ] Verify code review workflow runs successfully on this PR - [ ] Unpin to `@v1` once upstream fix (anthropics/claude-code-action#1186) ships Closes #1612 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dereference: trueto thecpSynccall that snapshots PR-authored sensitive paths into.claude-pr/ENOENT: no such file or directory, symlinkcrash when a sensitive path (e.g.CLAUDE.md) is a symlinkProblem
cpSyncdefaults todereference: false, which means it tries to recreate symlinks at the destination rather than copying file contents. When a sensitive path likeCLAUDE.mdis a symlink (e.g.CLAUDE.md -> AGENTS.md), the copy fails becausecpSynccallssymlink()without ensuring the parent.claude-pr/directory exists first.Error:
Fix
Adding
dereference: truefollows symlinks and copies the actual file contents instead of recreating the symlink. This 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/.Test plan
CLAUDE.mdis a symlink to another file