mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
fix: add support for pull_request_target event in GitHub Actions workflows (#579)
Add pull_request_target event support to enable Claude Code usage with forked repositories while maintaining proper security boundaries. This resolves issues with dependabot PRs and external contributions that require write permissions. Changes: - Add pull_request_target to supported GitHub events in context parsing - Update type definitions to include PullRequestTargetEvent - Modify IS_PR calculation to detect pull_request_target as PR context - Add comprehensive test coverage for pull_request_target workflows - Update documentation to reflect pull_request_target support The pull_request_target event provides the same payload structure as pull_request but runs with write permissions from the base repository, making it ideal for secure automation of external contributions. Fixes #347
This commit is contained in:
@@ -259,7 +259,7 @@ runs:
|
||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
||||
TRIGGER_COMMENT_ID: ${{ github.event.comment.id }}
|
||||
CLAUDE_BRANCH: ${{ steps.prepare.outputs.CLAUDE_BRANCH }}
|
||||
IS_PR: ${{ github.event.issue.pull_request != null || github.event_name == 'pull_request_review_comment' }}
|
||||
IS_PR: ${{ github.event.issue.pull_request != null || github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review_comment' }}
|
||||
BASE_BRANCH: ${{ steps.prepare.outputs.BASE_BRANCH }}
|
||||
CLAUDE_SUCCESS: ${{ steps.claude-code.outputs.conclusion == 'success' }}
|
||||
OUTPUT_FILE: ${{ steps.claude-code.outputs.execution_file || '' }}
|
||||
|
||||
Reference in New Issue
Block a user