From b570f2eb8ebf342682182bb2b613576d48c99971 Mon Sep 17 00:00:00 2001 From: claude Date: Tue, 29 Jul 2025 21:54:56 +0000 Subject: [PATCH] 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 --- action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index ca7a34f..ca6eae4 100644 --- a/action.yml +++ b/action.yml @@ -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 }}