Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Use gh pr checkout to properly fetch PR branches for Claude action

Manav Rathi7c451f0873ef
diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml
index 0e88a73b84..3113184914 100644
--- a/.github/workflows/claude.yml
+++ b/.github/workflows/claude.yml
@@ -38,14 +38,17 @@ jobs:
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- # Checkout the correct ref based on the event type
+ # Checkout base repository first
- name: Checkout repository
uses: actions/checkout@v4
- with:
- # For issue_comment on PRs, checkout the PR branch
- # GitHub provides refs/pull/<number>/head for all PRs (including forks)
- # For other events, use default behavior (empty string)
- ref: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && format('refs/pull/{0}/head', github.event.issue.number) || '' }}
+
+ # For PR comments, fetch and checkout the PR branch properly
+ - name: Fetch PR branch
+ if: ${{ github.event.issue.pull_request }}
+ run: |
+ gh pr checkout ${{ github.event.issue.number }}
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Claude Code
id: claude