From 8f5c91aad959c2a6346280de8b47d16788e27b18 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 1 Apr 2021 20:07:51 +0200 Subject: [PATCH] Handle GitHub server URL for default context Signed-off-by: CrazyMax --- dist/index.js | 2 +- src/context.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index c1ea7b8..989e3ff 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13014,7 +13014,7 @@ let _defaultContext, _tmpDir; function defaultContext() { var _a, _b; if (!_defaultContext) { - _defaultContext = `https://github.com/${github.context.repo.owner}/${github.context.repo.repo}.git#${(_b = (_a = github.context) === null || _a === void 0 ? void 0 : _a.ref) === null || _b === void 0 ? void 0 : _b.replace(/^refs\//, '')}`; + _defaultContext = `${process.env.GITHUB_SERVER_URL || 'https://github.com'}/${github.context.repo.owner}/${github.context.repo.repo}.git#${(_b = (_a = github.context) === null || _a === void 0 ? void 0 : _a.ref) === null || _b === void 0 ? void 0 : _b.replace(/^refs\//, '')}`; } return _defaultContext; } diff --git a/src/context.ts b/src/context.ts index 9b81fdd..35df65a 100644 --- a/src/context.ts +++ b/src/context.ts @@ -37,7 +37,7 @@ export interface Inputs { export function defaultContext(): string { if (!_defaultContext) { - _defaultContext = `https://github.com/${github.context.repo.owner}/${ + _defaultContext = `${process.env.GITHUB_SERVER_URL || 'https://github.com'}/${github.context.repo.owner}/${ github.context.repo.repo }.git#${github.context?.ref?.replace(/^refs\//, '')}`; }