Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit 516ef60

Browse files
authored
Add support for GitHub Enterprise (#24)
1 parent 85a4385 commit 516ef60

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-app-token",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"license": "MIT",
55
"files": [
66
"action.yml",

src/fetch-installation-token.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { context, getOctokit } from "@actions/github";
1+
import { getOctokit } from "@actions/github";
22
import { createAppAuth } from "@octokit/auth-app";
3+
import { request } from "@octokit/request";
34

45
export const fetchInstallationToken = async ({
56
appId,
@@ -12,7 +13,15 @@ export const fetchInstallationToken = async ({
1213
privateKey: string;
1314
repo: string;
1415
}>): Promise<string> => {
15-
const app = createAppAuth({ appId, privateKey });
16+
const app = createAppAuth({
17+
appId,
18+
privateKey,
19+
request: request.defaults({
20+
// GITHUB_API_URL is part of GitHub Actions' built-in environment variables.
21+
// See https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables.
22+
baseUrl: process.env["GITHUB_API_URL"]
23+
})
24+
});
1625
const authApp = await app({ type: "app" });
1726
const octokit = getOctokit(authApp.token);
1827
const {

0 commit comments

Comments
 (0)