Skip to content

Commit

Permalink
Get GitHub API URL from env var
Browse files Browse the repository at this point in the history
  • Loading branch information
7Hazard committed Aug 28, 2023
1 parent 17cde8a commit 566ec5e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dist/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15061,7 +15061,8 @@ async function main(appId2, privateKey2, repository2, core3, createAppAuth2, req
repo,
headers: {
authorization: `bearer ${appAuthentication.token}`
}
},
baseUrl: process.env["GITHUB_API_URL"]
}
);
const authentication = await auth({
Expand Down
4 changes: 4 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import core from "@actions/core";
import { createAppAuth } from "@octokit/auth-app";
import { request } from "@octokit/request";

request.defaults({
baseUrl: process.env["GITHUB_API_URL"],
});

/**
* @param {string} appId
* @param {string} privateKey
Expand Down
6 changes: 5 additions & 1 deletion lib/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import core from "@actions/core";
import { request } from "@octokit/request";

request.defaults({
baseUrl: process.env["GITHUB_API_URL"],
});

/**
* @param {core} core
* @param {request} request
Expand All @@ -11,7 +15,7 @@ export async function post(core, request) {
const token = core.getState("token");

if (!token) return;

await request("DELETE /installation/token", {
headers: {
authorization: `token ${token}`,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 566ec5e

Please sign in to comment.