mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 06:54:13 +08:00
fix: add baseUrl to Octokit initialization in update_claude_comment (#157)
* fix: add baseUrl to Octokit initialization in update_claude_comment Fixes Bad credentials error on GitHub Enterprise Server by passing GITHUB_API_URL as baseUrl when initializing Octokit, consistent with other Octokit instances in the codebase. Fixes #156 Related to #107 Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com> * fix: pass GITHUB_API_URL as env var to MCP server Update the MCP server initialization to pass GITHUB_API_URL as an environment variable, allowing it to work correctly with GitHub Enterprise Server instances. Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com> * fix: import GITHUB_API_URL from config in install-mcp-server Use the centralized GITHUB_API_URL constant from src/github/api/config.ts instead of reading directly from process.env when passing environment variables to the MCP server. This ensures consistency with how the API URL is handled throughout the codebase. Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com> * fix --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>
This commit is contained in:
@@ -466,6 +466,7 @@ server.tool(
|
|||||||
|
|
||||||
const octokit = new Octokit({
|
const octokit = new Octokit({
|
||||||
auth: githubToken,
|
auth: githubToken,
|
||||||
|
baseUrl: GITHUB_API_URL,
|
||||||
});
|
});
|
||||||
|
|
||||||
const isPullRequestReviewComment =
|
const isPullRequestReviewComment =
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
import { GITHUB_API_URL } from "../github/api/config";
|
||||||
|
|
||||||
type PrepareConfigParams = {
|
type PrepareConfigParams = {
|
||||||
githubToken: string;
|
githubToken: string;
|
||||||
@@ -46,6 +47,7 @@ export async function prepareMcpConfig(
|
|||||||
...(claudeCommentId && { CLAUDE_COMMENT_ID: claudeCommentId }),
|
...(claudeCommentId && { CLAUDE_COMMENT_ID: claudeCommentId }),
|
||||||
GITHUB_EVENT_NAME: process.env.GITHUB_EVENT_NAME || "",
|
GITHUB_EVENT_NAME: process.env.GITHUB_EVENT_NAME || "",
|
||||||
IS_PR: process.env.IS_PR || "false",
|
IS_PR: process.env.IS_PR || "false",
|
||||||
|
GITHUB_API_URL: GITHUB_API_URL,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user