anthropics / anthropics/claude-code-action

Support refresh tokens for Claude Max subscribers in GitHub Actions

Offen
#727 4 Kommentare 20 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:installation enhancement p2 provider:1p
Vorherrschende Sprache
TypeScript
Sterne
8.9k
Forks
2.1k
Ø Merge
3 T. 9 Std.
Gemergte PRs (30 T.)
10

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.