Skip to content

Commit d7c9c70

Browse files
committed
Get GitHub API URL from env var
1 parent 17cde8a commit d7c9c70

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import core from "@actions/core";
44
import { createAppAuth } from "@octokit/auth-app";
55
import { request } from "@octokit/request";
66

7+
request.defaults({
8+
baseUrl: process.env["GITHUB_API_URL"],
9+
});
10+
711
/**
812
* @param {string} appId
913
* @param {string} privateKey

lib/post.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
import core from "@actions/core";
44
import { request } from "@octokit/request";
55

6+
request.defaults({
7+
baseUrl: process.env["GITHUB_API_URL"],
8+
});
9+
610
/**
711
* @param {core} core
812
* @param {request} request
@@ -11,7 +15,7 @@ export async function post(core, request) {
1115
const token = core.getState("token");
1216

1317
if (!token) return;
14-
18+
1519
await request("DELETE /installation/token", {
1620
headers: {
1721
authorization: `token ${token}`,

0 commit comments

Comments
 (0)