Skip to content

Commit 2302871

Browse files
committed
update readme and yml examples with secrets_admin_pat
1 parent 6a8e6c9 commit 2302871

File tree

6 files changed

+41
-12
lines changed

6 files changed

+41
-12
lines changed

README.md

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bash <(curl -fsSL https://raw.githubusercontent.com/grll/claude-code-grll-instal
1515
More details about the installer [here](https://github.com/grll/claude-code-grll-installer).
1616

1717
### Key Improvements:
18-
- **✅ Fixed Token Expiry Issue (#2)**: The action now automatically refreshes OAuth tokens using a GitHub Personal Access Token (PAT). Learn how to create the PAT [here](https://github.com/grll/claude-code-login?tab=readme-ov-file#prerequisites-setting-up-secrets_admin_pat).
18+
- **✅ Fixed Token Expiry Issue (#2)**: The action now automatically refreshes OAuth tokens using a GitHub Personal Access Token (PAT). Learn how to create the PAT [here](https://github.com/grll/claude-code-login?tab=readme-ov-file#prerequisites-setting-up-secrets_admin_pat). After creating the PAT, you must add it to your repository secrets as `SECRETS_ADMIN_PAT` and include it in your action configuration.
1919
- **🔄 New OAuth Branch Creation**: We've created a new GitHub action that creates an "OAuth" branch without invalidating your local OAuth setup: https://github.com/grll/claude-code-login
2020

2121
---
@@ -71,6 +71,7 @@ This fork allows Claude Max subscribers to use their subscription in GitHub Acti
7171
- `CLAUDE_ACCESS_TOKEN`: Your Claude OAuth access token
7272
- `CLAUDE_REFRESH_TOKEN`: Your Claude OAuth refresh token
7373
- `CLAUDE_EXPIRES_AT`: The token expiration timestamp
74+
- `SECRETS_ADMIN_PAT`: Your GitHub Personal Access Token with `secrets:write` permission (for auto-refreshing tokens)
7475
4. Use the OAuth configuration in your workflow (see examples below)
7576

7677
## 📚 FAQ
@@ -120,6 +121,7 @@ jobs:
120121
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
121122
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
122123
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
124+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
123125

124126
timeout_minutes: "60"
125127
# Optional: add custom trigger phrase (default: @claude)
@@ -144,6 +146,7 @@ jobs:
144146
| `claude_access_token` | Claude AI OAuth access token (required when use_oauth is true) | No | - |
145147
| `claude_refresh_token`| Claude AI OAuth refresh token (required when use_oauth is true) | No | - |
146148
| `claude_expires_at` | Claude AI OAuth token expiration timestamp (required when use_oauth is true) | No | - |
149+
| `secrets_admin_pat` | Personal Access Token with secrets:write permission to refresh OAuth tokens (required when use_oauth is true) | No | - |
147150
| `direct_prompt` | Direct prompt for Claude to execute automatically without needing a trigger (for automated workflows) | No | - |
148151
| `max_turns` | Maximum number of conversation turns Claude can take (limits back-and-forth exchanges) | No | - |
149152
| `timeout_minutes` | Timeout in minutes for execution | No | `30` |
@@ -171,9 +174,13 @@ The `mcp_config` input allows you to add custom MCP (Model Context Protocol) ser
171174
#### Basic Example: Adding a Sequential Thinking Server
172175

173176
```yaml
174-
- uses: anthropics/claude-code-action@beta
177+
- uses: grll/claude-code-action@beta
175178
with:
176-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
179+
use_oauth: true
180+
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
181+
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
182+
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
183+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
177184
mcp_config: |
178185
{
179186
"mcpServers": {
@@ -195,9 +202,13 @@ The `mcp_config` input allows you to add custom MCP (Model Context Protocol) ser
195202
For MCP servers that require sensitive information like API keys or tokens, use GitHub Secrets in the environment variables:
196203

197204
```yaml
198-
- uses: anthropics/claude-code-action@beta
205+
- uses: grll/claude-code-action@beta
199206
with:
200-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
207+
use_oauth: true
208+
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
209+
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
210+
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
211+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
201212
mcp_config: |
202213
{
203214
"mcpServers": {
@@ -219,9 +230,13 @@ For MCP servers that require sensitive information like API keys or tokens, use
219230
For Python-based MCP servers managed with `uv`, you need to specify the directory containing your server:
220231

221232
```yaml
222-
- uses: anthropics/claude-code-action@beta
233+
- uses: grll/claude-code-action@beta
223234
with:
224-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
235+
use_oauth: true
236+
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
237+
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
238+
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
239+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
225240
mcp_config: |
226241
{
227242
"mcpServers": {
@@ -402,8 +417,13 @@ This action is built on top of [`anthropics/claude-code-base-action`](https://gi
402417
You can pass custom environment variables to Claude Code execution using the `claude_env` input. This is useful for CI/test setups that require specific environment variables:
403418

404419
```yaml
405-
- uses: anthropics/claude-code-action@beta
420+
- uses: grll/claude-code-action@beta
406421
with:
422+
use_oauth: true
423+
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
424+
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
425+
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
426+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
407427
claude_env: |
408428
NODE_ENV: test
409429
CI: true
@@ -422,9 +442,13 @@ You can use the `max_turns` parameter to limit the number of back-and-forth exch
422442
- Ensuring predictable behavior in CI/CD pipelines
423443

424444
```yaml
425-
- uses: anthropics/claude-code-action@beta
445+
- uses: grll/claude-code-action@beta
426446
with:
427-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
447+
use_oauth: true
448+
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
449+
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
450+
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
451+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
428452
max_turns: "5" # Limit to 5 conversation turns
429453
# ... other inputs
430454
```
@@ -493,8 +517,8 @@ For detailed setup instructions for AWS Bedrock and Google Vertex AI, see the [o
493517
Use provider-specific model names based on your chosen provider:
494518

495519
```yaml
496-
# For direct Anthropic API (default)
497-
- uses: grll/claude-code-action@beta # Fork with OAuth support
520+
# For direct Anthropic API (not recommended - use OAuth instead)
521+
- uses: grll/claude-code-action@beta
498522
with:
499523
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
500524
# ... other inputs

examples/claude-authorized-users.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ jobs:
4444
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
4545
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
4646
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
47+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
4748
timeout_minutes: "60"

examples/claude-auto-review.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
2525
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
2626
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
27+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
2728
timeout_minutes: "60"
2829
direct_prompt: |
2930
Please review this pull request and provide comprehensive feedback.

examples/claude-pr-path-specific.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
3232
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
3333
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
34+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
3435
timeout_minutes: "60"
3536
direct_prompt: |
3637
Please review this pull request focusing on the changed files.

examples/claude-review-from-author.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
3030
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
3131
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
32+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
3233
timeout_minutes: "60"
3334
direct_prompt: |
3435
Please provide a thorough review of this pull request.

examples/claude.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ jobs:
3636
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
3737
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
3838
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
39+
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
3940
timeout_minutes: "60"

0 commit comments

Comments
 (0)