Skip to content

Fix Claude action authentication to use github_token instead of OAuth app - #1651

Merged
sierra-moxon merged 2 commits into
masterfrom
copilot/fix-claude-action
Nov 21, 2025
Merged

Fix Claude action authentication to use github_token instead of OAuth app#1651
sierra-moxon merged 2 commits into
masterfrom
copilot/fix-claude-action

Conversation

Copilot AI commented Nov 21, 2025

Copy link
Copy Markdown
Contributor

The Claude Code workflows were failing with 401 Unauthorized because they required the Claude Code GitHub App to be installed. The app is not installed on this repository.

Changes

  • .github/workflows/claude.yml: Replace claude_code_oauth_token with github_token and anthropic_api_key
  • .github/workflows/claude-code-review.yml: Same authentication change
# Before
with:
  claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

# After
with:
  github_token: ${{ secrets.GITHUB_TOKEN }}
  anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

This aligns with the authentication pattern already used by the custom Claude actions in .github/actions/.

Note: Requires ANTHROPIC_API_KEY secret to be configured in repository settings (appears to already exist based on other workflows).

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix claude action</issue_title>
<issue_description>@copilot

fix the claude failing GH action:

  • @types/node@20.19.9
  • @types/node-fetch@2.6.12
  • prettier@3.5.3
  • typescript@5.8.3
  • @actions/core@1.11.1
  • @actions/github@6.0.1
  • @modelcontextprotocol/sdk@1.16.0
  • @octokit/graphql@8.2.2
  • @octokit/rest@21.1.1
  • @octokit/webhooks-types@7.6.1
  • node-fetch@3.3.2
  • zod@3.25.76

147 packages installed [498.00ms]
Run bun run ${GITHUB_ACTION_PATH}/src/entrypoints/prepare.ts
Requesting OIDC token...
Attempt 1 of 3...
OIDC token successfully obtained
Exchanging OIDC token for app token...
Attempt 1 of 3...
App token exchange failed: 401 Unauthorized - Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
Attempt 1 failed: Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
Retrying in 5 seconds...
Attempt 2 of 3...
App token exchange failed: 401 Unauthorized - Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
Retrying in 10 seconds...
Attempt 2 failed: Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
Attempt 3 of 3...
App token exchange failed: 401 Unauthorized - Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
Attempt 3 failed: Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
Operation failed after 3 attempts
Error: Failed to setup GitHub token: Error: Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude

If you instead wish to use this action with a custom GitHub token or custom GitHub app, provide a github_token in the uses section of the app in your workflow yml file.
Error: Process completed with exit code 1.
Run curl -L
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 112 0 112 0 0 2936 0 --:--:-- --:--:-- --:--:-- 2947
{
"message": "Bad credentials",
"documentation_url": "https://docs.github.com/rest",
"status": "401"</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: sierra-moxon <4561292+sierra-moxon@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix claude failing GitHub action Fix Claude action authentication to use github_token instead of OAuth app Nov 21, 2025
Copilot AI requested a review from sierra-moxon November 21, 2025 23:36
@sierra-moxon

Copy link
Copy Markdown
Member

@copilot - why is this check skipped Claude Code / claude (pull_request_review)

Copilot AI commented Nov 21, 2025

Copy link
Copy Markdown
Contributor Author

@copilot - why is this check skipped Claude Code / claude (pull_request_review)

The check was skipped because the workflow has a conditional that only runs when the comment/review contains '@claude'. Your comment mentions '@copilot', so the workflow's if condition (line 20-24 in claude.yml) evaluated to false and skipped execution. The workflow would only run if you mention '@claude' in a comment or review.

Copilot AI requested a review from sierra-moxon November 21, 2025 23:44
@sierra-moxon
sierra-moxon marked this pull request as ready for review November 21, 2025 23:50
@sierra-moxon
sierra-moxon merged commit 5d7a3af into master Nov 21, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix claude action

2 participants