Skip to content

Commit f5c7db5

Browse files
paul-fractureclaude
andcommitted
Fix secret naming for reusable workflows
- Renamed GITHUB_TOKEN to GH_TOKEN in reusable workflows to avoid reserved name collision - Updated README and example files to use the new secret name - Fixed issue with GitHub reserved name validation in workflows - This addresses the "secret name 'GITHUB_TOKEN' within workflow_call can not be used" error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c542ac5 commit f5c7db5

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

.github/workflows/claude-full.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ on:
2626
secrets:
2727
ANTHROPIC_API_KEY:
2828
required: true
29-
GITHUB_TOKEN:
29+
GH_TOKEN:
3030
required: true
31+
description: 'GitHub token for repository access'
3132

3233
jobs:
3334
# Handle issue analysis comments
@@ -70,7 +71,7 @@ jobs:
7071
feedback: ${{ steps.issue.outputs.feedback }}
7172
debug-mode: ${{ inputs.debug-mode || 'false' }}
7273
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
73-
github-token: ${{ secrets.GITHUB_TOKEN }}
74+
github-token: ${{ secrets.GH_TOKEN }}
7475

7576
- name: Upload claude output artifacts
7677
if: always()
@@ -96,7 +97,7 @@ jobs:
9697

9798
- name: Setup GitHub CLI
9899
run: |
99-
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
100+
gh auth login --with-token <<< "${{ secrets.GH_TOKEN }}"
100101
101102
- name: Setup git user
102103
run: |
@@ -131,7 +132,7 @@ jobs:
131132
debug-mode: ${{ inputs.debug-mode || 'false' }}
132133
feedback: ${{ steps.issue.outputs.feedback }}
133134
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
134-
github-token: ${{ secrets.GITHUB_TOKEN }}
135+
github-token: ${{ secrets.GH_TOKEN }}
135136

136137
- name: Upload claude output artifacts
137138
if: always()
@@ -178,7 +179,7 @@ jobs:
178179
feedback: ${{ steps.pr.outputs.feedback }}
179180
debug-mode: ${{ inputs.debug-mode || 'false' }}
180181
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
181-
github-token: ${{ secrets.GITHUB_TOKEN }}
182+
github-token: ${{ secrets.GH_TOKEN }}
182183

183184
process-pr-suggestions:
184185
runs-on: ubuntu-latest
@@ -218,7 +219,7 @@ jobs:
218219
strict-mode: ${{ inputs.strict-mode || 'true' }}
219220
debug-mode: ${{ inputs.debug-mode || 'false' }}
220221
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
221-
github-token: ${{ secrets.GITHUB_TOKEN }}
222+
github-token: ${{ secrets.GH_TOKEN }}
222223

223224
# Handle code review comments
224225
process-review-comment:
@@ -274,7 +275,7 @@ jobs:
274275
feedback: ${{ steps.details.outputs.feedback }}
275276
debug-mode: ${{ inputs.debug-mode || 'false' }}
276277
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
277-
github-token: ${{ secrets.GITHUB_TOKEN }}
278+
github-token: ${{ secrets.GH_TOKEN }}
278279

279280
process-suggest-review-comment:
280281
runs-on: ubuntu-latest
@@ -333,4 +334,4 @@ jobs:
333334
strict-mode: ${{ inputs.strict-mode || 'true' }}
334335
debug-mode: ${{ inputs.debug-mode || 'false' }}
335336
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
336-
github-token: ${{ secrets.GITHUB_TOKEN }}
337+
github-token: ${{ secrets.GH_TOKEN }}

.github/workflows/claude-label-fix.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ on:
2121
secrets:
2222
ANTHROPIC_API_KEY:
2323
required: true
24-
GITHUB_TOKEN:
24+
GH_TOKEN:
2525
required: true
26+
description: 'GitHub token for repository access'
2627

2728
jobs:
2829
process-issue-fix:
@@ -41,7 +42,7 @@ jobs:
4142

4243
- name: Setup GitHub CLI
4344
run: |
44-
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
45+
gh auth login --with-token <<< "${{ secrets.GH_TOKEN }}"
4546
4647
- name: Setup git user
4748
run: |
@@ -59,7 +60,7 @@ jobs:
5960
issue-label: ${{ inputs.issue-label || 'claude-fix' }}
6061
debug-mode: ${{ inputs.debug-mode || 'false' }}
6162
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
62-
github-token: ${{ secrets.GITHUB_TOKEN }}
63+
github-token: ${{ secrets.GH_TOKEN }}
6364

6465
- name: Upload claude output artifacts
6566
if: always()

.github/workflows/example-minimal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
strict-mode: true # Set to false to allow Claude to make additional improvements
1919
secrets:
2020
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
issue-label: 'claude-fix' # Optional: customize the trigger label
3636
secrets:
3737
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
```
4040
4141
**File: `.github/workflows/claude-issue-fix.yml`**
@@ -53,7 +53,7 @@ jobs:
5353
issue-label: 'claude-fix' # Must match your chosen label
5454
secrets:
5555
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5757
```
5858

5959
### 2. Use Claude in PRs and Issues
@@ -108,7 +108,7 @@ jobs:
108108
strict-mode: true # When false, allows Claude to add improvements
109109
secrets:
110110
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
111-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112112
```
113113

114114
### Label-Based Integration (`claude-label-fix.yml`)
@@ -124,7 +124,7 @@ jobs:
124124
debug-mode: false # Enable verbose logging
125125
secrets:
126126
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
127-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
127+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128128
```
129129

130130
Only repo maintainers with write access can add labels, providing security control over which issues Claude will fix.

0 commit comments

Comments
 (0)