mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-08-22 03:18:54 +08:00
restoreConfigFromBase replaces .claude/, CLAUDE.md and the other sensitive paths with the PR base branch's versions, then deliberately unstages them so the revert does not reach a commit. checkAndCommitOrDeleteBranch then ran a bare `git add -A`, which staged them again and pushed a silent revert of the PR author's own config onto their branch, under a commit message that says only "Auto-commit: Save uncommitted changes from Claude". restoreConfigFromBase now returns the paths it restored. run.ts threads them through updateCommentLink into checkAndCommitOrDeleteBranch, which excludes them via pathspec from both the staging and the git status check. The exclusion is driven by what was actually restored rather than applied unconditionally. This path also runs for issues, where no restore happens and Claude may legitimately have been asked to edit CLAUDE.md or .claude/settings.json; excluding those there would silently drop the work — trading one silent-data-loss bug for another. Reverting the fix, dropping the status scoping, and switching to an unconditional exclusion each fail the new tests. The status check is scoped the same way as the staging: when the reverted config is the only dirty entry there is no real work, so the branch is now correctly treated as empty and deleted instead of receiving a pure revert. Reachable on a closed or merged PR where Claude left uncommitted changes with use_commit_signing false — the only combination where a restore has run and claudeBranch is set. Fixes #1669