mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 06:54:13 +08:00
Add claude_code_oauth_token parameter to all test workflow files to support new authentication method. This ensures proper authentication for Claude Code API access in GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
name: Test Claude Env Feature
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test-claude-env-with-comments:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
|
|
- name: Test with comments in env
|
|
id: comment-test
|
|
uses: ./base-action
|
|
with:
|
|
prompt: |
|
|
Use the Bash tool to run: echo "VAR1: $VAR1" && echo "VAR2: $VAR2"
|
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
claude_env: |
|
|
# This is a comment
|
|
VAR1: value1
|
|
# Another comment
|
|
VAR2: value2
|
|
|
|
# Empty lines above should be ignored
|
|
allowed_tools: "Bash(echo:*)"
|
|
timeout_minutes: "2"
|
|
|
|
- name: Verify comment handling
|
|
run: |
|
|
OUTPUT_FILE="${{ steps.comment-test.outputs.execution_file }}"
|
|
if [ "${{ steps.comment-test.outputs.conclusion }}" = "success" ]; then
|
|
echo "✅ Comments in claude_env handled correctly"
|
|
if grep -q "value1" "$OUTPUT_FILE" && grep -q "value2" "$OUTPUT_FILE"; then
|
|
echo "✅ Environment variables set correctly despite comments"
|
|
else
|
|
echo "❌ Environment variables not found"
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "❌ Failed with comments in claude_env"
|
|
exit 1
|
|
fi
|