Skip to content

ci(claude): checkout with fetch-depth: 0 so the review bot works on fork PRs#1671

Merged
sbryngelson merged 1 commit into
MFlowCode:masterfrom
sbryngelson:fix-claude-workflow
Jul 24, 2026
Merged

ci(claude): checkout with fetch-depth: 0 so the review bot works on fork PRs#1671
sbryngelson merged 1 commit into
MFlowCode:masterfrom
sbryngelson:fix-claude-workflow

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

Description

The Claude Code workflow (.github/workflows/claude.yml) has no checkout step, so anthropics/claude-code-action@v1 performs its own shallow git fetch --depth=20 pull/<n>/head to obtain the PR. On fork PRs that fetch fails — the shallow base lacks the objects needed to reconcile the PR head — and the whole action aborts before it can post a review:

Failed to compute SHA for <file>: Command failed: git hash-object <file>
##[error]Action failed with error: Command failed: git fetch origin --depth=20 pull/<n>/head

(Observed on #1670.)

This adds a full-history checkout (fetch-depth: 0) before the action, giving it the history it needs so the internal fetch succeeds. This mirrors the sibling claude-code-review.yml, which already checks out with fetch-depth: 0 and does not hit this failure.

Type of change

  • Bug fix (CI)

Testing

  • YAML validated (yaml.safe_load).
  • ./mfc.sh precheck passes.
  • One-line CI-only change; no source or toolchain behavior is affected.

Checklist

  • I added or updated tests for new behavior — n/a (CI workflow fix)
  • I updated documentation if user-facing behavior changed — n/a

…ork PRs

The Claude Code workflow (claude.yml) had no checkout step, so claude-code-action
runs its own shallow `git fetch --depth=20 pull/<n>/head`. On fork PRs that fetch
fails (the shallow base lacks the objects to reconcile), aborting the action before
it can review. Adding a fetch-depth: 0 checkout gives the action the history it needs,
mirroring the working claude-code-review.yml.
Copilot AI review requested due to automatic review settings July 24, 2026 00:52
@sbryngelson sbryngelson added the claude-full-review Trigger Claude Code review label Jul 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Claude Code GitHub Actions workflow to ensure the anthropics/claude-code-action@v1 step has sufficient git history available to successfully fetch and reconcile fork-based PR heads (avoiding failures caused by shallow history).

Changes:

  • Add an explicit actions/checkout step with fetch-depth: 0 ahead of the Claude action.
  • Document why the full-history checkout is required and align behavior with claude-code-review.yml.

Comment thread .github/workflows/claude.yml
@sbryngelson
sbryngelson merged commit 86165fc into MFlowCode:master Jul 24, 2026
31 checks passed
@sbryngelson
sbryngelson deleted the fix-claude-workflow branch July 24, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-full-review Trigger Claude Code review

Development

Successfully merging this pull request may close these issues.

2 participants