mirror of
https://github.com/docker/build-push-action
synced 2024-11-26 20:11:40 +00:00
Merge pull request #328 from crazy-max/github-serverurl
Handle GitHub server URL for default context
This commit is contained in:
commit
2ec8f1d346
2 changed files with 2 additions and 2 deletions
2
dist/index.js
generated
vendored
2
dist/index.js
generated
vendored
|
@ -13014,7 +13014,7 @@ let _defaultContext, _tmpDir;
|
||||||
function defaultContext() {
|
function defaultContext() {
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
if (!_defaultContext) {
|
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;
|
return _defaultContext;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ export interface Inputs {
|
||||||
|
|
||||||
export function defaultContext(): string {
|
export function defaultContext(): string {
|
||||||
if (!_defaultContext) {
|
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
|
github.context.repo.repo
|
||||||
}.git#${github.context?.ref?.replace(/^refs\//, '')}`;
|
}.git#${github.context?.ref?.replace(/^refs\//, '')}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue