Skip to content

Fix API key billing mode for Max plan#72

Merged
piatoss3612 merged 8 commits into
masterfrom
claude/fix-api-billing-mode-MFpG8
Jan 8, 2026
Merged

Fix API key billing mode for Max plan#72
piatoss3612 merged 8 commits into
masterfrom
claude/fix-api-billing-mode-MFpG8

Conversation

@piatoss3612
Copy link
Copy Markdown
Member

No description provided.

claude added 3 commits January 7, 2026 23:26
Changes:
- Replace anthropic_api_key with claude_code_oauth_token to use Max plan instead of API billing
- Upgrade permissions from read to write for pull-requests and issues (needed for posting reviews/comments)
- Add show_full_output: true to both workflows for better error visibility

This fixes the issue where Claude workflows were trying to use API billing mode
instead of the Max subscription plan, and couldn't post reviews due to insufficient permissions.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 7, 2026

No issues found. Checked for bugs and CLAUDE.md compliance.

claude added 3 commits January 7, 2026 23:41
- Restore claude-code-review.yml and claude.yml workflows
- Use claude_code_oauth_token for Max plan billing instead of API key
- Add github_token for OIDC authentication
- Set pull-requests and issues to write permissions for posting reviews/comments
Resolved conflicts by keeping the modified GitHub Actions workflows with OAuth token configuration.
Master branch had reverted these workflows, but we're re-introducing them with fixes:
- Use claude_code_oauth_token instead of anthropic_api_key for Max plan billing
- Add github_token for OIDC authentication
- Upgrade permissions to write for pull-requests and issues
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 7, 2026


Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@claude
is it okay to give write permission?

Copy link
Copy Markdown

@github-actions github-actions Bot Jan 8, 2026

Choose a reason for hiding this comment

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

Claude finished @piatoss3612's task in 46s —— View job


Analysis of write permissions in workflow

  • Read the workflow file to understand permission configuration
  • Analyze security implications
  • Provide recommendation

Answer

Yes, these write permissions are necessary and safe for the Claude Code workflow. Here's why:

Permissions breakdown (.github/workflows/claude.yml:21-26):

permissions:
  contents: read           # Read repository code
  pull-requests: write     # Line 23 - Post/update PR comments
  issues: write            # Post/update issue comments
  id-token: write          # OIDC authentication
  actions: read            # Read CI results

Why pull-requests: write and issues: write are needed:

  1. Core functionality: Claude Code needs to post and update comments on PRs and issues to communicate with you. Without write permissions, Claude cannot respond to your @claude mentions.

  2. Scoped appropriately: These permissions only allow:

    • Creating/updating comments
    • NOT merging PRs
    • NOT modifying repository code directly
    • NOT approving PRs
  3. Standard practice: This is the recommended configuration for the Claude Code GitHub Action.

Security considerations:

Safe because:

  • Uses GITHUB_TOKEN with automatic scoping to this repository only
  • Permissions are minimal for the required functionality
  • Action only runs when explicitly triggered by @claude mentions
  • All code changes require explicit push via git commands
  • Uses OIDC (id-token: write) for secure authentication

⚠️ Important: The workflow does allow Claude to push commits to branches when you request code changes. If you want to prevent this, you'd need to restrict Claude's allowed tools, but then it couldn't implement code changes for you.

Both workflow files (.github/workflows/claude.yml and .github/workflows/claude-code-review.yml) use identical permission sets, which is correct for their functionality.


claude added 2 commits January 8, 2026 03:22
Only run code review for PR authors who are:
- OWNER: Repository owners
- MEMBER: Organization members
- COLLABORATOR: Repository collaborators

This prevents external contributors and first-time contributors from triggering automated code reviews.
Add author_association checks for all event types:
- issue_comment: Only OWNER/MEMBER/COLLABORATOR can mention @claude in issue comments
- pull_request_review_comment: Only OWNER/MEMBER/COLLABORATOR can mention @claude in PR review comments
- pull_request_review: Only OWNER/MEMBER/COLLABORATOR can mention @claude in PR reviews
- issues: Only OWNER/MEMBER/COLLABORATOR can mention @claude in issue body/title

This prevents external contributors from invoking Claude via @claude mentions.
@piatoss3612 piatoss3612 merged commit 545b4b9 into master Jan 8, 2026
1 check passed
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.

2 participants