1
0
Fork 0
mirror of https://github.com/docker/build-push-action.git synced 2025-04-23 07:06:37 +02:00

Fix ref spec for default Git context

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-04-26 11:02:09 +02:00
parent c0c3e27be3
commit 19c07384dc
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
3 changed files with 28 additions and 15 deletions

10
dist/index.js generated vendored
View file

@ -13013,9 +13013,15 @@ const github = __importStar(__webpack_require__(438));
const buildx = __importStar(__webpack_require__(295));
let _defaultContext, _tmpDir;
function defaultContext() {
var _a, _b;
if (!_defaultContext) {
_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\//, '')}`;
let ref = github.context.ref;
if (github.context.sha && ref && !ref.startsWith('refs/')) {
ref = `refs/heads/${github.context.ref}`;
}
if (github.context.sha && !ref.startsWith(`refs/pull/`)) {
ref = github.context.sha;
}
_defaultContext = `${process.env.GITHUB_SERVER_URL || 'https://github.com'}/${github.context.repo.owner}/${github.context.repo.repo}.git#${ref}`;
}
return _defaultContext;
}