Skip to content

armgit / ente

Public Imported from GitHub
0

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

Simplify Claude workflow PR checkout to use refs/pull/<id>/head

Manav Rathi87622dfbc589
diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml
index e624858700..0e88a73b84 100644
--- a/.github/workflows/claude.yml
+++ b/.github/workflows/claude.yml
@@ -38,25 +38,14 @@ jobs:
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- # For issue_comment events on PRs, we need to fetch the PR details first
- - name: Get PR details
- if: github.event_name == 'issue_comment' && github.event.issue.pull_request
- id: pr_details
- uses: octokit/[email protected]
- with:
- route: ${{ github.event.issue.pull_request.url }}
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
# Checkout the correct ref based on the event type
- name: Checkout repository
uses: actions/checkout@v4
with:
- # For PR comments from forks, use the PR head SHA
- # For other events, use the default behavior
- ref: ${{ (github.event_name == 'issue_comment' && github.event.issue.pull_request) && fromJson(steps.pr_details.outputs.data).head.sha || '' }}
- # Also specify the repository for fork PRs
- repository: ${{ (github.event_name == 'issue_comment' && github.event.issue.pull_request && fromJson(steps.pr_details.outputs.data).head.repo.full_name != github.repository) && fromJson(steps.pr_details.outputs.data).head.repo.full_name || github.repository }}
+ # 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) || '' }}
- name: Run Claude Code
id: claude