anthropics / anthropics/claude-code-action

Support refresh tokens for Claude Max subscribers in GitHub Actions

Aperta
#727 4 commenti 20 reazioni 0 assegnatari Vedi su GitHub
area:installation enhancement p2 provider:1p
Lingua principale
TypeScript
Stelle
8.9k
Fork
2.1k
Merge medio
3g 9h
PR unite (30g)
10

Descrizione

## 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.