fix: add baseUrl to Octokit constructor, if appropriate, for GHE (#52)
This attempts to fix the issue reported at https://github.com/openai/codex-action/issues/32. I don't have access to a GHE account, so this is hard to test, but this looks right according to: https://github.com/octokit/octokit.js/blob/45c56ffaa6d1799dd4ebaf83f06a8fc64fc39c49/README.md#L197-L201
This commit is contained in:
Vendored
+6
-2
File diff suppressed because one or more lines are too long
@@ -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}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user