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:
parent
c0c3e27be3
commit
19c07384dc
3 changed files with 28 additions and 15 deletions
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue