Fix anthropic_api_key parameter passed to claude-code-base-action

Don't pass 'use-oauth' value to the base action when using OAuth authentication. This allows Claude Code to properly detect and use the OAuth credentials file instead of trying to use 'use-oauth' as an API key.
This commit is contained in:
claude
2025-07-29 19:58:44 +00:00
parent 5342a9c5f9
commit 4f5899b843

View File

@@ -124,7 +124,8 @@ runs:
mcp_config: ${{ steps.prepare.outputs.mcp_config }} mcp_config: ${{ steps.prepare.outputs.mcp_config }}
use_bedrock: ${{ inputs.use_bedrock }} use_bedrock: ${{ inputs.use_bedrock }}
use_vertex: ${{ inputs.use_vertex }} use_vertex: ${{ inputs.use_vertex }}
anthropic_api_key: ${{ inputs.anthropic_api_key }} # Don't pass anthropic_api_key when using OAuth
anthropic_api_key: ${{ inputs.anthropic_api_key != 'use-oauth' && inputs.anthropic_api_key || '' }}
env: env:
# Core configuration # Core configuration
PROMPT_FILE: /tmp/claude-prompts/claude-prompt.txt PROMPT_FILE: /tmp/claude-prompts/claude-prompt.txt