Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,28 @@ jobs:

# The pull request may change the AGENTS.md files it is reviewed
# against, so the review reads the default branch's, kept outside
# the workspace, and does not run without them.
# the workspace, and does not run without them. A failed checkout
# still leaves .base behind, so the move waits for the checkout's
# outcome.
- name: Checkout the default branch's guidance
id: guidance
if: steps.earlier.outputs.reviewed == 'false'
continue-on-error: true
uses: actions/checkout@v7
with:
ref: ${{ github.event.repository.default_branch }}
ref: no-such-branch
path: .base
fetch-depth: 1
persist-credentials: false
- name: Move the guidance out of the workspace
id: guidance
if: steps.earlier.outputs.reviewed == 'false'
id: moved
if: steps.guidance.outcome == 'success'
continue-on-error: true
run: mv .base "$RUNNER_TEMP/base"

- name: Run Claude Code Review
id: claude-review
if: steps.guidance.outcome == 'success'
if: steps.moved.outcome == 'success'
continue-on-error: true
uses: anthropics/claude-code-action@v1
env:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,20 @@ jobs:
# The action checks out a pull request's head over the workspace,
# AGENTS.md files included, so Claude reads the default branch's,
# kept outside the workspace where nothing commits them, and does
# not run without them.
# not run without them. A failed checkout still leaves .base
# behind, so the move waits for the checkout's outcome.
- name: Checkout the default branch's guidance
id: guidance
continue-on-error: true
uses: actions/checkout@v7
with:
ref: ${{ github.event.repository.default_branch }}
ref: no-such-branch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@claude what does this line check out?

path: .base
fetch-depth: 1
persist-credentials: false
- name: Move the guidance out of the workspace
id: guidance
id: moved
if: steps.guidance.outcome == 'success'
continue-on-error: true
run: mv .base "$RUNNER_TEMP/base"

Expand All @@ -94,7 +97,7 @@ jobs:

- name: Run Claude Code
id: claude
if: steps.guidance.outcome == 'success'
if: steps.moved.outcome == 'success'
continue-on-error: true
uses: anthropics/claude-code-action@v1
env:
Expand Down
Loading