Skip to content

fix: skip SHA computation for newly added files in PRs#989

Open
yoheidemachi wants to merge 1 commit intoanthropics:mainfrom
yoheidemachi:fix/skip-sha-for-added-files
Open

fix: skip SHA computation for newly added files in PRs#989
yoheidemachi wants to merge 1 commit intoanthropics:mainfrom
yoheidemachi:fix/skip-sha-for-added-files

Conversation

@yoheidemachi
Copy link

fetchGitHubData() runs before setupBranch() in prepareTagMode(), so files marked as ADDED in a PR don't exist on disk yet when git hash-object is called. This causes fatal: could not open '<file>' for reading: No such file or directory errors for PRs that add new files.

Changes

Skip SHA computation for ADDED files (like we already do for DELETED), using "added" as the SHA placeholder.

Execution order

  1. fetchGitHubData() — calls git hash-object on changed files (fails for ADDED files)
  2. setupBranch() — checks out PR branch (files become available, but too late)

Closes #979

fetchGitHubData() runs before setupBranch(), so files marked as ADDED
in a PR don't exist on disk yet when git hash-object is called. This
caused fatal errors for PRs that add new files.

Skip SHA computation for ADDED files (like we already do for DELETED),
using "added" as the SHA placeholder.

Fixes anthropics#979

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Action fails on PRs with newly added files - git hash-object called before PR checkout

1 participant