Accept claude-code-oauth-token as auth alternative to claude-api-key#107
Open
adelaidasofia wants to merge 1 commit into
Open
Accept claude-code-oauth-token as auth alternative to claude-api-key#107adelaidasofia wants to merge 1 commit into
adelaidasofia wants to merge 1 commit into
Conversation
Adds a second authentication path so users with a Max or Pro
subscription can run this action without provisioning a separate
Anthropic API key.
Changes:
- action.yml: claude-api-key is no longer 'required: true' on its own;
the new claude-code-oauth-token input is the alternative. Validation
now accepts either. Both are passed as env vars (ANTHROPIC_API_KEY
and CLAUDE_CODE_OAUTH_TOKEN respectively) so the underlying claude
CLI auto-selects the right auth method.
- claudecode/github_action_audit.py: validation in
check_claude_code_available accepts either env var.
The optional Claude-AI false-positive filter still requires
ANTHROPIC_API_KEY (it's a direct SDK call, not via claude CLI).
OAuth-only users gracefully fall back to hard-rules filtering, which
matches existing behavior when use_claude_filtering is disabled.
Mint a long-lived OAuth token with: claude setup-token
Then in your workflow:
- uses: anthropics/claude-code-security-review@main
with:
claude-code-oauth-token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
Author
|
Friendly bump. This is rebased and green. It accepts claude-code-oauth-token as an auth alternative to claude-api-key, which unblocks running the action on a Claude subscription instead of a metered API key. Happy to adjust if you would prefer a different approach. Thanks. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a second authentication path so users with a Max or Pro subscription can run this action without provisioning a separate Anthropic API key.
Changes
action.yml:claude-api-keyis no longerrequired: trueon its own. The newclaude-code-oauth-tokeninput is the alternative. Validation accepts either input. Both are passed as env vars (ANTHROPIC_API_KEYandCLAUDE_CODE_OAUTH_TOKENrespectively) so the underlying Claude CLI auto-selects the right auth method.claudecode/github_action_audit.py: validation incheck_claude_code_availableaccepts either env var.Limitation
The optional Claude-AI false-positive filter still requires
ANTHROPIC_API_KEYbecause it is a direct SDK call (not via the Claude CLI). OAuth-only users gracefully fall back to hard-rules filtering, which matches the existing behavior whenuse_claude_filteringis disabled.Usage example
Mint a long-lived OAuth token locally:
Set the secret on your repo, then in your workflow:
Why
The companion action
anthropics/claude-code-actionalready acceptsclaude_code_oauth_tokenas input. This bringsclaude-code-security-reviewto parity so subscription users can adopt both actions without a separate API-key billing path.Thank you for considering.