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 d7c9c70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit d7c9c70

Please sign in to comment.