Skip to content

Commit 02e7b29

Browse files
authored
fix: add baseUrl to Octokit constructor, if appropriate, for GHE (#52)
This attempts to fix the issue reported at #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
1 parent 3dafd12 commit 02e7b29

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

dist/main.js

Lines changed: 6 additions & 2 deletions
Large diffs are not rendered by default.

src/checkActorPermissions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ export async function ensureActorHasWriteAccess(
103103
};
104104
}
105105

106-
const octokit = options.octokit ?? new Octokit({ auth: token });
106+
const baseUrl = process.env.GITHUB_API_URL?.trim();
107+
const octokit =
108+
options.octokit ??
109+
new Octokit({
110+
auth: token,
111+
...(baseUrl ? { baseUrl } : {}),
112+
});
107113

108114
core.info(`Checking write access for actor '${actor}' on ${owner}/${repo}`);
109115

0 commit comments

Comments
 (0)