fix: update warden CI auth to use CLAUDE_CODE_OAUTH_TOKEN #28
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Warden | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| jobs: | |
| claude-auth-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Claude Code | |
| run: | | |
| curl -fsSL https://claude.ai/install.sh | bash -s -- "2.1.31" | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| - name: Verify claude binary | |
| run: | | |
| which claude | |
| claude --version | |
| - name: Setup auth | |
| run: | | |
| mkdir -p ~/.claude | |
| echo '{"hasCompletedOnboarding": true}' > ~/.claude.json | |
| - name: Test claude auth with haiku | |
| env: | |
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.WARDEN_ANTHROPIC_API_KEY }} | |
| run: | | |
| export CLAUDE_CODE_OAUTH_TOKEN="$(printf '%s' "$CLAUDE_CODE_OAUTH_TOKEN" | tr -d '\n\r\t ')" | |
| echo "Testing Claude Code authentication..." | |
| echo "CLAUDE_CODE_OAUTH_TOKEN is set: $([ -n "$CLAUDE_CODE_OAUTH_TOKEN" ] && echo 'yes' || echo 'no')" | |
| echo "Token length: ${#CLAUDE_CODE_OAUTH_TOKEN}" | |
| echo "Token prefix: ${CLAUDE_CODE_OAUTH_TOKEN:0:10}..." | |
| claude -p "Say hi in exactly 3 words" --model claude-3-5-haiku-20241022 --verbose 2>&1 | |
| review: | |
| runs-on: ubuntu-latest | |
| env: | |
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.WARDEN_ANTHROPIC_API_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Strip newlines from OAuth token | |
| run: echo "CLAUDE_CODE_OAUTH_TOKEN=$(printf '%s' "$CLAUDE_CODE_OAUTH_TOKEN" | tr -d '\n\r\t ')" >> "$GITHUB_ENV" | |
| - name: Fix warden CLAUDE_CODE_PATH | |
| run: sudo mkdir -p /.local/bin && sudo ln -sf /home/runner/.local/bin/claude /.local/bin/claude | |
| - uses: getsentry/warden@fix/propagate-sdk-errors |