diff --git a/dist/main.cjs b/dist/main.cjs index ebaec51..d28fa90 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -15081,12 +15081,19 @@ if (!process.env.GITHUB_REPOSITORY) { var appId = import_core2.default.getInput("app_id"); var privateKey = import_core2.default.getInput("private_key"); var repository = process.env.GITHUB_REPOSITORY; -main(appId, privateKey, repository, import_core2.default, import_auth_app.createAppAuth, import_request.request).catch( - (error) => { - console.error(error); - import_core2.default.setFailed(error.message); - } -); +main( + appId, + privateKey, + repository, + import_core2.default, + import_auth_app.createAppAuth, + import_request.request.defaults({ + baseUrl: process.env["GITHUB_API_URL"] + }) +).catch((error) => { + console.error(error); + import_core2.default.setFailed(error.message); +}); /*! Bundled license information: is-plain-object/dist/is-plain-object.js: diff --git a/dist/post.cjs b/dist/post.cjs index aaec5d7..8f558c7 100644 --- a/dist/post.cjs +++ b/dist/post.cjs @@ -2969,12 +2969,15 @@ async function post(core3, request2) { } // post.js -post(import_core2.default, import_request.request).catch( - (error) => { - console.error(error); - import_core2.default.setFailed(error.message); - } -); +post( + import_core2.default, + import_request.request.defaults({ + baseUrl: process.env["GITHUB_API_URL"] + }) +).catch((error) => { + console.error(error); + import_core2.default.setFailed(error.message); +}); /*! Bundled license information: is-plain-object/dist/is-plain-object.js: diff --git a/lib/post.js b/lib/post.js index a0efe15..bfbae77 100644 --- a/lib/post.js +++ b/lib/post.js @@ -11,7 +11,7 @@ export async function post(core, request) { const token = core.getState("token"); if (!token) return; - + await request("DELETE /installation/token", { headers: { authorization: `token ${token}`, diff --git a/main.js b/main.js index 02ffcc2..eb480d4 100644 --- a/main.js +++ b/main.js @@ -15,9 +15,16 @@ const privateKey = core.getInput("private_key"); const repository = process.env.GITHUB_REPOSITORY; -main(appId, privateKey, repository, core, createAppAuth, request).catch( - (error) => { - console.error(error); - core.setFailed(error.message); - } -); +main( + appId, + privateKey, + repository, + core, + createAppAuth, + request.defaults({ + baseUrl: process.env["GITHUB_API_URL"], + }) +).catch((error) => { + console.error(error); + core.setFailed(error.message); +}); diff --git a/package.json b/package.json index 6746225..26f3bde 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "create-github-app-token", "private": true, "type": "module", - "version": "1.1.5", + "version": "1.2.0", "description": "GitHub Action for creating a GitHub App Installation Access Token", "scripts": { "build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node16.16", diff --git a/post.js b/post.js index 0e34a59..145bc7e 100644 --- a/post.js +++ b/post.js @@ -5,9 +5,12 @@ import { request } from "@octokit/request"; import { post } from "./lib/post.js"; -post(core, request).catch( - (error) => { - console.error(error); - core.setFailed(error.message); - } -); +post( + core, + request.defaults({ + baseUrl: process.env["GITHUB_API_URL"], + }) +).catch((error) => { + console.error(error); + core.setFailed(error.message); +});