Skip to content

feat: auto-select LLM provider in PR review workflow - #6

Merged
menil merged 1 commit into
mainfrom
feat/anthropic-oauth-support
Aug 27, 2026
Merged

feat: auto-select LLM provider in PR review workflow#6
menil merged 1 commit into
mainfrom
feat/anthropic-oauth-support

Conversation

@menil

@menil menil commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Updates the template's pr-review.yml to pass through the new anthropic_api_key / claude_code_oauth_token inputs added by menil/pr-code-review-action (see feat: support Claude Pro/Max OAuth token auth pr-code-review-action#26).
  • provider is now computed automatically from which secrets are configured on the consuming repo: a Claude Code subscription token (CLAUDE_CODE_OAUTH_TOKEN) is preferred over a billed API key (ANTHROPIC_API_KEY) when both are set, and it falls back to openrouter when neither is set — matching the pattern already applied to pr-code-review-action's own workflow.
  • Adds vars-based overrides for the Anthropic model/base URL/max tokens, mirroring the existing OpenRouter override convention.

Test plan

https://claude.ai/code/session_01NBXWBSZNTfweRrPhJterDW

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Needs Attention (1 issue)

  1. [Dependency & Deployment Safety] Action version should be pinned instead of using @main - file:.github/workflows/pr-review.yml:20
    Using menil/pr-code-review-action@main can introduce unexpected breaking changes. Consider pinning to a specific version tag (e.g., @v1.0.0) for stability and predictability in CI/CD pipelines.

Suggestions (1 item)

  1. [Quality & Readability] Simplify provider selection logic (MED impact, LOW effort)
    The ternary expression on line 25 is correct but difficult to parse. Consider extracting this into a separate variable or using a more explicit conditional for clarity, especially for maintainers unfamiliar with GitHub Actions expression syntax.

All Clear

  • Correctness & Logic: No bugs or edge case issues detected
  • Static Analysis & Types: YAML syntax and GitHub Actions expressions are valid
  • Security: No credentials hardcoded; proper use of GitHub Actions secrets handling
  • PII Detection: No personally identifiable information exposed
  • Test Quality: Workflow properly supports integration testing
  • Backward Compatibility: OpenRouter configuration remains functional; Anthropic is purely additive

Verdict: Needs Attention

Address the action version pinning concern before merging to ensure deployment safety and prevent unexpected breakages from upstream changes.

Comment thread .github/workflows/pr-review.yml Outdated
Passes through the new anthropic_api_key/claude_code_oauth_token
inputs and picks provider automatically based on which secrets are
configured, preferring a Claude Code subscription token over a billed
Anthropic API key, falling back to OpenRouter when neither is set.

Claude-Session: https://claude.ai/code/session_01NBXWBSZNTfweRrPhJterDW
@menil
menil force-pushed the feat/anthropic-oauth-support branch from 2ce57d4 to 7bac2d3 Compare August 27, 2026 23:44
@menil

menil commented Aug 27, 2026

Copy link
Copy Markdown
Owner Author

Thanks for the review!

  • On pinning menil/pr-code-review-action to a version tag: we're intentionally staying on @main for now.
  • The provider-selection ternary readability suggestion has been applied in this commit.

@menil
menil merged commit 3aa8309 into main Aug 27, 2026
@menil
menil deleted the feat/anthropic-oauth-support branch August 27, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant