anthropics / anthropics/claude-code-action

Support refresh tokens for Claude Max subscribers in GitHub Actions

Đang mở
#727 4 bình luận 20 reaction 0 người được giao Xem trên GitHub
area:installation enhancement p2 provider:1p
Ngôn ngữ chính
TypeScript
Star
8.9k
Fork
2.1k
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
10

Mô tả

## Problem

Claude Max subscribers cannot reliably use the GitHub Action with their subscription. The current OAuth flow produces tokens that expire in approximately 1 day, making it impractical for CI/CD use.

## Current Situation

1. The action supports `claude_code_oauth_token` as an alternative to `anthropic_api_key`
2. Subscribers can extract OAuth tokens from `~/.claude/` after running `/login`
3. These tokens expire quickly (~1 day)
4. There is no `claude_code_refresh_token` input to automatically refresh expired tokens
5. The `/install-github-app` command sets up tokens but they also expire quickly

## Expected Behavior

Max subscribers should be able to use their subscription with GitHub Actions without:
- Paying additional API costs
- Manually refreshing tokens daily
- Building custom refresh automation

## Proposed Solutions

1. **Add refresh token support**: Accept a `claude_code_refresh_token` input and automatically refresh the access token when expired
2. **Longer-lived tokens**: Issue longer-lived OAuth tokens for CI/CD use cases
3. **GitHub App OAuth**: The Claude GitHub App should handle authentication automatically for subscribers who have installed it and linked their account

## Workaround

Currently the only reliable option is to use `anthropic_api_key`, which incurs additional costs beyond the Max subscription.

## Environment

- Claude Code version: 2.0.56
- Using: Claude Max subscription
- Action: anthropics/claude-code-action

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.