Skip to content

Commit 22fe3f9

Browse files
authored
ci(common): locally claude clone private repo for read-only access (#1830)
* ci(common): clone both marketplace and tech-specs in claude action - Clone zama-ai/zama-marketplace and zama-ai/tech-specs to /tmp/ - Use CLAUDE_ACCESS_TOKEN PAT for auth (replaces OIDC token exchange) - tech-spec will be available for future PR comparisons via filesystem - Update comments to reflect actual secrets used * ci(common): fix typos
1 parent c6cdefd commit 22fe3f9

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

.github/workflows/claude.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ name: claude-review
1414
#
1515
# Secrets required:
1616
# - CLAUDE_CODE_OAUTH_TOKEN: OAuth token from `claude setup-token`
17+
# - CLAUDE_ACCESS_TOKEN: PAT with 'repo' scope for private repos (zama-marketplace, tech-specs)
1718
#
18-
# Note: Private marketplaces are cloned in a separate step using the Claude GitHub App token,
19+
# Note: Private marketplaces are cloned in a separate step using a dedicated PAT,
1920
# then passed as a local path to avoid git auth issues in the action's setup.
2021

2122
on:
2223
issue_comment:
2324
types: [created]
2425
pull_request_review_comment:
2526
types: [created]
27+
pull_request:
28+
types: [opened, synchronize]
2629

2730
permissions: {}
2831

@@ -48,36 +51,12 @@ jobs:
4851
- name: Install uv
4952
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b
5053

51-
- name: Get Claude App token
52-
id: claude-token
53-
run: |
54-
# Get OIDC token
55-
OIDC_RESPONSE=$(curl -s -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
56-
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=claude-code-github-action")
57-
OIDC_TOKEN=$(echo "$OIDC_RESPONSE" | jq -r '.value')
58-
59-
if [ -z "$OIDC_TOKEN" ] || [ "$OIDC_TOKEN" = "null" ]; then
60-
echo "❌ Failed to get OIDC token"
61-
exit 1
62-
fi
63-
64-
# Exchange for GitHub App token
65-
APP_RESPONSE=$(curl -s -X POST https://api.anthropic.com/api/github/github-app-token-exchange \
66-
-H "Authorization: Bearer $OIDC_TOKEN")
67-
APP_TOKEN=$(echo "$APP_RESPONSE" | jq -r '.token // .app_token')
68-
69-
if [ -z "$APP_TOKEN" ] || [ "$APP_TOKEN" = "null" ]; then
70-
echo "❌ Failed to exchange for App token"
71-
exit 1
72-
fi
73-
74-
echo "token=$APP_TOKEN" >> "$GITHUB_OUTPUT"
75-
76-
- name: Clone private marketplace
54+
- name: Clone private repositories
7755
run: |
7856
gh repo clone zama-ai/zama-marketplace /tmp/zama-marketplace
57+
gh repo clone zama-ai/tech-spec /tmp/tech-spec
7958
env:
80-
GH_TOKEN: ${{ steps.claude-token.outputs.token }}
59+
GH_TOKEN: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
8160

8261
- name: Run Claude Code
8362
uses: anthropics/claude-code-action@a017b830c03e23789b11fb69ed571ea61c12e45c # 2026-01-16

0 commit comments

Comments
 (0)