fix(GHES): respect GITHUB_API_URL when creating installation access token (#38)

Follow up to #36. I just wanted to do some refactoring but turns out I
missed to pass the custom `request` instance to `createAppAuth`. It will
fallback to the default `request` which does not respect
`GITHUB_API_URL`
This commit is contained in:
Gregor Martynus
2023-08-29 22:29:41 -07:00
committed by GitHub
parent c72844caa4
commit c08c5ace34
5 changed files with 16 additions and 14 deletions

View File

@@ -1,16 +1,12 @@
// @ts-check
import core from "@actions/core";
import { createAppAuth } from "@octokit/auth-app";
import { request } from "@octokit/request";
/**
* @param {string} appId
* @param {string} privateKey
* @param {string} repository
* @param {core} core
* @param {createAppAuth} createAppAuth
* @param {request} request
* @param {import("@actions/core")} core
* @param {import("@octokit/auth-app").createAppAuth} createAppAuth
* @param {import("@octokit/request").request} request
*/
export async function main(
appId,
@@ -26,6 +22,7 @@ export async function main(
const auth = createAppAuth({
appId,
privateKey,
request,
});
const appAuthentication = await auth({