Skip to content

Commit 48ffb0c

Browse files
committed
Handle Claude action credentials explicitly
1 parent 81e84e9 commit 48ffb0c

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/scan-watched-repos.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,24 @@ jobs:
116116
name: watcher-context-${{ matrix.slug }}
117117
path: build/context/${{ matrix.slug }}.*
118118

119+
- name: Verify Claude credentials are configured
120+
env:
121+
HAS_ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY != '' && 'true' || 'false' }}
122+
HAS_CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN != '' && 'true' || 'false' }}
123+
run: |
124+
if [ "${HAS_ANTHROPIC_API_KEY}" != "true" ] && [ "${HAS_CLAUDE_CODE_OAUTH_TOKEN}" != "true" ]; then
125+
echo "::error::Set either ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN for the Claude review workflow."
126+
exit 1
127+
fi
128+
119129
- name: Ask Claude for qualitative review
120130
uses: anthropics/claude-code-action@v1
121131
env:
122132
GH_TOKEN: ${{ github.token }}
123133
with:
124134
github_token: ${{ github.token }}
125135
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
136+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
126137
prompt: |
127138
Review the last `${{ needs.select-targets.outputs.lookback_days }}` days of agent-related GitHub activity for `${{ matrix.repo }}`.
128139

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ python3 scripts/run_watch.py \
5656
The scheduled workflow expects:
5757

5858
- `WATCHER_SOURCE_TOKEN`: token with read access to watched repositories
59-
- `ANTHROPIC_API_KEY`: used by the Claude Code Action
59+
- one of `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN`: used by the Claude Code Action
6060
- `GITHUB_TOKEN`: the default workflow token is used by Claude to create or append issues in this repo
6161

6262
`WATCHER_SOURCE_TOKEN` can be a fine-grained PAT or GitHub App token. The collector only needs read access to issues, pull requests, metadata, comments, and reviews on watched repos.

docs/design.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ Two token roles are enough for the first pass:
103103
- `WATCHER_SOURCE_TOKEN`
104104
- read access on watched repos
105105
- used for listing issues, comments, PRs, and reviews in watched repos
106-
- `ANTHROPIC_API_KEY`
107-
- used by the Claude Code Action
106+
- `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN`
107+
- one of these must be present for the Claude Code Action
108108
- `GITHUB_TOKEN`
109109
- write access on this repo issues
110110
- used by Claude for issue creation, reopening, body updates, and appended comments

0 commit comments

Comments
 (0)