fix: add baseUrl to Octokit constructor, if appropriate, for GHE

This commit is contained in:
Michael Bolin
2025-11-05 14:27:48 -08:00
parent 3dafd127f5
commit 5445635324
2 changed files with 13 additions and 3 deletions
+6 -2
View File
File diff suppressed because one or more lines are too long
+7 -1
View File
@@ -103,7 +103,13 @@ export async function ensureActorHasWriteAccess(
};
}
const octokit = options.octokit ?? new Octokit({ auth: token });
const baseUrl = process.env.GITHUB_API_URL?.trim();
const octokit =
options.octokit ??
new Octokit({
auth: token,
...(baseUrl ? { baseUrl } : {}),
});
core.info(`Checking write access for actor '${actor}' on ${owner}/${repo}`);