From 584c6fe31432bbccd60688d210e0f703942de5d8 Mon Sep 17 00:00:00 2001 From: Steven Hartland Date: Tue, 18 Jan 2022 18:16:09 +0000 Subject: [PATCH] fix(tool-cache): support enterprise instances Remove hard code api.github.com reference in tool-cache so that it works when used in GitHub Enterprise instances. Fixes #644 --- packages/tool-cache/src/tool-cache.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/tool-cache/src/tool-cache.ts b/packages/tool-cache/src/tool-cache.ts index 92fd519a..13afda37 100644 --- a/packages/tool-cache/src/tool-cache.ts +++ b/packages/tool-cache/src/tool-cache.ts @@ -593,7 +593,8 @@ export async function getManifestFromRepo( branch = 'master' ): Promise { let releases: IToolRelease[] = [] - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}` + const base = process.env['GITHUB_API_URL'] || 'https://api.github.com' + const treeUrl = `${base}/repos/${owner}/${repo}/git/trees/${branch}` const http: httpm.HttpClient = new httpm.HttpClient('tool-cache') const headers: IHeaders = {}