Fix OAuth: Add CLAUDE_CODE_OAUTH_TOKEN env var and fix API key handling

- Add CLAUDE_CODE_OAUTH_TOKEN to environment variables for base action
- Don't pass 'use-oauth' as anthropic_api_key to base action
- This should allow Claude Code to detect and use OAuth properly
This commit is contained in:
claude
2025-07-29 21:54:56 +00:00
parent 5bab3fdadc
commit b570f2eb8e

View File

@@ -124,7 +124,7 @@ runs:
mcp_config: ${{ steps.prepare.outputs.mcp_config }}
use_bedrock: ${{ inputs.use_bedrock }}
use_vertex: ${{ inputs.use_vertex }}
anthropic_api_key: ${{ inputs.anthropic_api_key }}
anthropic_api_key: ${{ inputs.anthropic_api_key != 'use-oauth' && inputs.anthropic_api_key || '' }}
claude_code_oauth_token: ${{ steps.prepare.outputs.claude_oauth_token }}
env:
# Core configuration
@@ -139,6 +139,8 @@ runs:
USE_VERTEX: ${{ inputs.use_vertex }}
# Only set ANTHROPIC_API_KEY if not using OAuth
ANTHROPIC_API_KEY: ${{ inputs.anthropic_api_key != 'use-oauth' && inputs.anthropic_api_key || '' }}
# OAuth token for Claude Code
CLAUDE_CODE_OAUTH_TOKEN: ${{ steps.prepare.outputs.claude_oauth_token }}
# GitHub token for repository access
GITHUB_TOKEN: ${{ steps.prepare.outputs.GITHUB_TOKEN }}