Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dac93a5ea3 |
5 changed files with 632 additions and 230 deletions
423
dist/main/index.js
vendored
423
dist/main/index.js
vendored
|
|
@ -3121,7 +3121,11 @@ module.exports = v4;
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|
@ -3134,7 +3138,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
@ -3196,13 +3200,13 @@ class Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function escapeData(s) {
|
function escapeData(s) {
|
||||||
return utils_1.toCommandValue(s)
|
return (0, utils_1.toCommandValue)(s)
|
||||||
.replace(/%/g, '%25')
|
.replace(/%/g, '%25')
|
||||||
.replace(/\r/g, '%0D')
|
.replace(/\r/g, '%0D')
|
||||||
.replace(/\n/g, '%0A');
|
.replace(/\n/g, '%0A');
|
||||||
}
|
}
|
||||||
function escapeProperty(s) {
|
function escapeProperty(s) {
|
||||||
return utils_1.toCommandValue(s)
|
return (0, utils_1.toCommandValue)(s)
|
||||||
.replace(/%/g, '%25')
|
.replace(/%/g, '%25')
|
||||||
.replace(/\r/g, '%0D')
|
.replace(/\r/g, '%0D')
|
||||||
.replace(/\n/g, '%0A')
|
.replace(/\n/g, '%0A')
|
||||||
|
|
@ -3220,7 +3224,11 @@ function escapeProperty(s) {
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|
@ -3233,7 +3241,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
@ -3247,7 +3255,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
||||||
const command_1 = __nccwpck_require__(4914);
|
const command_1 = __nccwpck_require__(4914);
|
||||||
const file_command_1 = __nccwpck_require__(4753);
|
const file_command_1 = __nccwpck_require__(4753);
|
||||||
const utils_1 = __nccwpck_require__(302);
|
const utils_1 = __nccwpck_require__(302);
|
||||||
|
|
@ -3267,7 +3275,7 @@ var ExitCode;
|
||||||
* A code indicating that the action was a failure
|
* A code indicating that the action was a failure
|
||||||
*/
|
*/
|
||||||
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
||||||
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
})(ExitCode || (exports.ExitCode = ExitCode = {}));
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Variables
|
// Variables
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
|
@ -3278,13 +3286,13 @@ var ExitCode;
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
function exportVariable(name, val) {
|
function exportVariable(name, val) {
|
||||||
const convertedVal = utils_1.toCommandValue(val);
|
const convertedVal = (0, utils_1.toCommandValue)(val);
|
||||||
process.env[name] = convertedVal;
|
process.env[name] = convertedVal;
|
||||||
const filePath = process.env['GITHUB_ENV'] || '';
|
const filePath = process.env['GITHUB_ENV'] || '';
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
|
return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val));
|
||||||
}
|
}
|
||||||
command_1.issueCommand('set-env', { name }, convertedVal);
|
(0, command_1.issueCommand)('set-env', { name }, convertedVal);
|
||||||
}
|
}
|
||||||
exports.exportVariable = exportVariable;
|
exports.exportVariable = exportVariable;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3292,7 +3300,7 @@ exports.exportVariable = exportVariable;
|
||||||
* @param secret value of the secret
|
* @param secret value of the secret
|
||||||
*/
|
*/
|
||||||
function setSecret(secret) {
|
function setSecret(secret) {
|
||||||
command_1.issueCommand('add-mask', {}, secret);
|
(0, command_1.issueCommand)('add-mask', {}, secret);
|
||||||
}
|
}
|
||||||
exports.setSecret = setSecret;
|
exports.setSecret = setSecret;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3302,10 +3310,10 @@ exports.setSecret = setSecret;
|
||||||
function addPath(inputPath) {
|
function addPath(inputPath) {
|
||||||
const filePath = process.env['GITHUB_PATH'] || '';
|
const filePath = process.env['GITHUB_PATH'] || '';
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
file_command_1.issueFileCommand('PATH', inputPath);
|
(0, file_command_1.issueFileCommand)('PATH', inputPath);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
command_1.issueCommand('add-path', {}, inputPath);
|
(0, command_1.issueCommand)('add-path', {}, inputPath);
|
||||||
}
|
}
|
||||||
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
||||||
}
|
}
|
||||||
|
|
@ -3380,10 +3388,10 @@ exports.getBooleanInput = getBooleanInput;
|
||||||
function setOutput(name, value) {
|
function setOutput(name, value) {
|
||||||
const filePath = process.env['GITHUB_OUTPUT'] || '';
|
const filePath = process.env['GITHUB_OUTPUT'] || '';
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
|
return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value));
|
||||||
}
|
}
|
||||||
process.stdout.write(os.EOL);
|
process.stdout.write(os.EOL);
|
||||||
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
|
(0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value));
|
||||||
}
|
}
|
||||||
exports.setOutput = setOutput;
|
exports.setOutput = setOutput;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3392,7 +3400,7 @@ exports.setOutput = setOutput;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function setCommandEcho(enabled) {
|
function setCommandEcho(enabled) {
|
||||||
command_1.issue('echo', enabled ? 'on' : 'off');
|
(0, command_1.issue)('echo', enabled ? 'on' : 'off');
|
||||||
}
|
}
|
||||||
exports.setCommandEcho = setCommandEcho;
|
exports.setCommandEcho = setCommandEcho;
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
|
@ -3423,7 +3431,7 @@ exports.isDebug = isDebug;
|
||||||
* @param message debug message
|
* @param message debug message
|
||||||
*/
|
*/
|
||||||
function debug(message) {
|
function debug(message) {
|
||||||
command_1.issueCommand('debug', {}, message);
|
(0, command_1.issueCommand)('debug', {}, message);
|
||||||
}
|
}
|
||||||
exports.debug = debug;
|
exports.debug = debug;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3432,7 +3440,7 @@ exports.debug = debug;
|
||||||
* @param properties optional properties to add to the annotation.
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function error(message, properties = {}) {
|
function error(message, properties = {}) {
|
||||||
command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
(0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.error = error;
|
exports.error = error;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3441,7 +3449,7 @@ exports.error = error;
|
||||||
* @param properties optional properties to add to the annotation.
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function warning(message, properties = {}) {
|
function warning(message, properties = {}) {
|
||||||
command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
(0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.warning = warning;
|
exports.warning = warning;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3450,7 +3458,7 @@ exports.warning = warning;
|
||||||
* @param properties optional properties to add to the annotation.
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function notice(message, properties = {}) {
|
function notice(message, properties = {}) {
|
||||||
command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
(0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.notice = notice;
|
exports.notice = notice;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3469,14 +3477,14 @@ exports.info = info;
|
||||||
* @param name The name of the output group
|
* @param name The name of the output group
|
||||||
*/
|
*/
|
||||||
function startGroup(name) {
|
function startGroup(name) {
|
||||||
command_1.issue('group', name);
|
(0, command_1.issue)('group', name);
|
||||||
}
|
}
|
||||||
exports.startGroup = startGroup;
|
exports.startGroup = startGroup;
|
||||||
/**
|
/**
|
||||||
* End an output group.
|
* End an output group.
|
||||||
*/
|
*/
|
||||||
function endGroup() {
|
function endGroup() {
|
||||||
command_1.issue('endgroup');
|
(0, command_1.issue)('endgroup');
|
||||||
}
|
}
|
||||||
exports.endGroup = endGroup;
|
exports.endGroup = endGroup;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3514,9 +3522,9 @@ exports.group = group;
|
||||||
function saveState(name, value) {
|
function saveState(name, value) {
|
||||||
const filePath = process.env['GITHUB_STATE'] || '';
|
const filePath = process.env['GITHUB_STATE'] || '';
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
|
return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value));
|
||||||
}
|
}
|
||||||
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
|
(0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value));
|
||||||
}
|
}
|
||||||
exports.saveState = saveState;
|
exports.saveState = saveState;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3552,6 +3560,10 @@ var path_utils_1 = __nccwpck_require__(1976);
|
||||||
Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
|
Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
|
||||||
Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
|
Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
|
||||||
Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
|
Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
|
||||||
|
/**
|
||||||
|
* Platform utilities exports
|
||||||
|
*/
|
||||||
|
exports.platform = __importStar(__nccwpck_require__(8968));
|
||||||
//# sourceMappingURL=core.js.map
|
//# sourceMappingURL=core.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
@ -3564,7 +3576,11 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct
|
||||||
// For internal use, subject to change.
|
// For internal use, subject to change.
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|
@ -3577,7 +3593,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
@ -3585,9 +3601,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
|
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
|
||||||
// We use any as a valid input type
|
// We use any as a valid input type
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
const crypto = __importStar(__nccwpck_require__(6982));
|
||||||
const fs = __importStar(__nccwpck_require__(9896));
|
const fs = __importStar(__nccwpck_require__(9896));
|
||||||
const os = __importStar(__nccwpck_require__(857));
|
const os = __importStar(__nccwpck_require__(857));
|
||||||
const uuid_1 = __nccwpck_require__(2048);
|
|
||||||
const utils_1 = __nccwpck_require__(302);
|
const utils_1 = __nccwpck_require__(302);
|
||||||
function issueFileCommand(command, message) {
|
function issueFileCommand(command, message) {
|
||||||
const filePath = process.env[`GITHUB_${command}`];
|
const filePath = process.env[`GITHUB_${command}`];
|
||||||
|
|
@ -3597,14 +3613,14 @@ function issueFileCommand(command, message) {
|
||||||
if (!fs.existsSync(filePath)) {
|
if (!fs.existsSync(filePath)) {
|
||||||
throw new Error(`Missing file at path: ${filePath}`);
|
throw new Error(`Missing file at path: ${filePath}`);
|
||||||
}
|
}
|
||||||
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
|
fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, {
|
||||||
encoding: 'utf8'
|
encoding: 'utf8'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.issueFileCommand = issueFileCommand;
|
exports.issueFileCommand = issueFileCommand;
|
||||||
function prepareKeyValueMessage(key, value) {
|
function prepareKeyValueMessage(key, value) {
|
||||||
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
|
const delimiter = `ghadelimiter_${crypto.randomUUID()}`;
|
||||||
const convertedValue = utils_1.toCommandValue(value);
|
const convertedValue = (0, utils_1.toCommandValue)(value);
|
||||||
// These should realistically never happen, but just in case someone finds a
|
// These should realistically never happen, but just in case someone finds a
|
||||||
// way to exploit uuid generation let's not allow keys or values that contain
|
// way to exploit uuid generation let's not allow keys or values that contain
|
||||||
// the delimiter.
|
// the delimiter.
|
||||||
|
|
@ -3689,9 +3705,9 @@ class OidcClient {
|
||||||
const encodedAudience = encodeURIComponent(audience);
|
const encodedAudience = encodeURIComponent(audience);
|
||||||
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
||||||
}
|
}
|
||||||
core_1.debug(`ID token url is ${id_token_url}`);
|
(0, core_1.debug)(`ID token url is ${id_token_url}`);
|
||||||
const id_token = yield OidcClient.getCall(id_token_url);
|
const id_token = yield OidcClient.getCall(id_token_url);
|
||||||
core_1.setSecret(id_token);
|
(0, core_1.setSecret)(id_token);
|
||||||
return id_token;
|
return id_token;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|
@ -3712,7 +3728,11 @@ exports.OidcClient = OidcClient;
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|
@ -3725,7 +3745,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
@ -3770,6 +3790,107 @@ exports.toPlatformPath = toPlatformPath;
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 8968:
|
||||||
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0;
|
||||||
|
const os_1 = __importDefault(__nccwpck_require__(857));
|
||||||
|
const exec = __importStar(__nccwpck_require__(5236));
|
||||||
|
const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
name: name.trim(),
|
||||||
|
version: version.trim()
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c, _d;
|
||||||
|
const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';
|
||||||
|
const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
version
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
const [name, version] = stdout.trim().split('\n');
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
version
|
||||||
|
};
|
||||||
|
});
|
||||||
|
exports.platform = os_1.default.platform();
|
||||||
|
exports.arch = os_1.default.arch();
|
||||||
|
exports.isWindows = exports.platform === 'win32';
|
||||||
|
exports.isMacOS = exports.platform === 'darwin';
|
||||||
|
exports.isLinux = exports.platform === 'linux';
|
||||||
|
function getDetails() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return Object.assign(Object.assign({}, (yield (exports.isWindows
|
||||||
|
? getWindowsInfo()
|
||||||
|
: exports.isMacOS
|
||||||
|
? getMacOsInfo()
|
||||||
|
: getLinuxInfo()))), { platform: exports.platform,
|
||||||
|
arch: exports.arch,
|
||||||
|
isWindows: exports.isWindows,
|
||||||
|
isMacOS: exports.isMacOS,
|
||||||
|
isLinux: exports.isLinux });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.getDetails = getDetails;
|
||||||
|
//# sourceMappingURL=platform.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ 1847:
|
/***/ 1847:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
|
@ -88529,6 +88650,7 @@ function composeDoc(options, directives, { offset, start, value, end }, onError)
|
||||||
const opts = Object.assign({ _directives: directives }, options);
|
const opts = Object.assign({ _directives: directives }, options);
|
||||||
const doc = new Document.Document(undefined, opts);
|
const doc = new Document.Document(undefined, opts);
|
||||||
const ctx = {
|
const ctx = {
|
||||||
|
atKey: false,
|
||||||
atRoot: true,
|
atRoot: true,
|
||||||
directives: doc.directives,
|
directives: doc.directives,
|
||||||
options: doc.options,
|
options: doc.options,
|
||||||
|
|
@ -88573,6 +88695,7 @@ exports.composeDoc = composeDoc;
|
||||||
|
|
||||||
|
|
||||||
var Alias = __nccwpck_require__(4065);
|
var Alias = __nccwpck_require__(4065);
|
||||||
|
var identity = __nccwpck_require__(1127);
|
||||||
var composeCollection = __nccwpck_require__(7349);
|
var composeCollection = __nccwpck_require__(7349);
|
||||||
var composeScalar = __nccwpck_require__(5413);
|
var composeScalar = __nccwpck_require__(5413);
|
||||||
var resolveEnd = __nccwpck_require__(7788);
|
var resolveEnd = __nccwpck_require__(7788);
|
||||||
|
|
@ -88580,6 +88703,7 @@ var utilEmptyScalarPosition = __nccwpck_require__(2599);
|
||||||
|
|
||||||
const CN = { composeNode, composeEmptyNode };
|
const CN = { composeNode, composeEmptyNode };
|
||||||
function composeNode(ctx, token, props, onError) {
|
function composeNode(ctx, token, props, onError) {
|
||||||
|
const atKey = ctx.atKey;
|
||||||
const { spaceBefore, comment, anchor, tag } = props;
|
const { spaceBefore, comment, anchor, tag } = props;
|
||||||
let node;
|
let node;
|
||||||
let isSrcToken = true;
|
let isSrcToken = true;
|
||||||
|
|
@ -88615,6 +88739,14 @@ function composeNode(ctx, token, props, onError) {
|
||||||
}
|
}
|
||||||
if (anchor && node.anchor === '')
|
if (anchor && node.anchor === '')
|
||||||
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
||||||
|
if (atKey &&
|
||||||
|
ctx.options.stringKeys &&
|
||||||
|
(!identity.isScalar(node) ||
|
||||||
|
typeof node.value !== 'string' ||
|
||||||
|
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
|
||||||
|
const msg = 'With stringKeys, all keys must be strings';
|
||||||
|
onError(tag ?? token, 'NON_STRING_KEY', msg);
|
||||||
|
}
|
||||||
if (spaceBefore)
|
if (spaceBefore)
|
||||||
node.spaceBefore = true;
|
node.spaceBefore = true;
|
||||||
if (comment) {
|
if (comment) {
|
||||||
|
|
@ -88687,11 +88819,16 @@ function composeScalar(ctx, token, tagToken, onError) {
|
||||||
const tagName = tagToken
|
const tagName = tagToken
|
||||||
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
||||||
: null;
|
: null;
|
||||||
const tag = tagToken && tagName
|
let tag;
|
||||||
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
if (ctx.options.stringKeys && ctx.atKey) {
|
||||||
: token.type === 'scalar'
|
tag = ctx.schema[identity.SCALAR];
|
||||||
? findScalarTagByTest(ctx, value, token, onError)
|
}
|
||||||
: ctx.schema[identity.SCALAR];
|
else if (tagName)
|
||||||
|
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
||||||
|
else if (token.type === 'scalar')
|
||||||
|
tag = findScalarTagByTest(ctx, value, token, onError);
|
||||||
|
else
|
||||||
|
tag = ctx.schema[identity.SCALAR];
|
||||||
let scalar;
|
let scalar;
|
||||||
try {
|
try {
|
||||||
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
||||||
|
|
@ -88739,8 +88876,9 @@ function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
||||||
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
||||||
return schema[identity.SCALAR];
|
return schema[identity.SCALAR];
|
||||||
}
|
}
|
||||||
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
||||||
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[identity.SCALAR];
|
const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
|
||||||
|
tag.test?.test(value)) || schema[identity.SCALAR];
|
||||||
if (schema.compat) {
|
if (schema.compat) {
|
||||||
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
||||||
schema[identity.SCALAR];
|
schema[identity.SCALAR];
|
||||||
|
|
@ -89046,12 +89184,14 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, ta
|
||||||
onError(offset, 'BAD_INDENT', startColMsg);
|
onError(offset, 'BAD_INDENT', startColMsg);
|
||||||
}
|
}
|
||||||
// key value
|
// key value
|
||||||
|
ctx.atKey = true;
|
||||||
const keyStart = keyProps.end;
|
const keyStart = keyProps.end;
|
||||||
const keyNode = key
|
const keyNode = key
|
||||||
? composeNode(ctx, key, keyProps, onError)
|
? composeNode(ctx, key, keyProps, onError)
|
||||||
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
||||||
if (ctx.schema.compat)
|
if (ctx.schema.compat)
|
||||||
utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
|
||||||
|
ctx.atKey = false;
|
||||||
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
||||||
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
||||||
// value properties
|
// value properties
|
||||||
|
|
@ -89334,6 +89474,8 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, ta
|
||||||
const seq = new NodeClass(ctx.schema);
|
const seq = new NodeClass(ctx.schema);
|
||||||
if (ctx.atRoot)
|
if (ctx.atRoot)
|
||||||
ctx.atRoot = false;
|
ctx.atRoot = false;
|
||||||
|
if (ctx.atKey)
|
||||||
|
ctx.atKey = false;
|
||||||
let offset = bs.offset;
|
let offset = bs.offset;
|
||||||
let commentEnd = null;
|
let commentEnd = null;
|
||||||
for (const { start, value } of bs.items) {
|
for (const { start, value } of bs.items) {
|
||||||
|
|
@ -89449,6 +89591,8 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
|
||||||
const atRoot = ctx.atRoot;
|
const atRoot = ctx.atRoot;
|
||||||
if (atRoot)
|
if (atRoot)
|
||||||
ctx.atRoot = false;
|
ctx.atRoot = false;
|
||||||
|
if (ctx.atKey)
|
||||||
|
ctx.atKey = false;
|
||||||
let offset = fc.offset + fc.start.source.length;
|
let offset = fc.offset + fc.start.source.length;
|
||||||
for (let i = 0; i < fc.items.length; ++i) {
|
for (let i = 0; i < fc.items.length; ++i) {
|
||||||
const collItem = fc.items[i];
|
const collItem = fc.items[i];
|
||||||
|
|
@ -89528,12 +89672,14 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
|
||||||
else {
|
else {
|
||||||
// item is a key+value pair
|
// item is a key+value pair
|
||||||
// key value
|
// key value
|
||||||
|
ctx.atKey = true;
|
||||||
const keyStart = props.end;
|
const keyStart = props.end;
|
||||||
const keyNode = key
|
const keyNode = key
|
||||||
? composeNode(ctx, key, props, onError)
|
? composeNode(ctx, key, props, onError)
|
||||||
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
||||||
if (isBlock(key))
|
if (isBlock(key))
|
||||||
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
||||||
|
ctx.atKey = false;
|
||||||
// value properties
|
// value properties
|
||||||
const valueProps = resolveProps.resolveProps(sep ?? [], {
|
const valueProps = resolveProps.resolveProps(sep ?? [], {
|
||||||
flow: fcName,
|
flow: fcName,
|
||||||
|
|
@ -90147,11 +90293,7 @@ function mapIncludes(ctx, items, search) {
|
||||||
return false;
|
return false;
|
||||||
const isEqual = typeof uniqueKeys === 'function'
|
const isEqual = typeof uniqueKeys === 'function'
|
||||||
? uniqueKeys
|
? uniqueKeys
|
||||||
: (a, b) => a === b ||
|
: (a, b) => a === b || (identity.isScalar(a) && identity.isScalar(b) && a.value === b.value);
|
||||||
(identity.isScalar(a) &&
|
|
||||||
identity.isScalar(b) &&
|
|
||||||
a.value === b.value &&
|
|
||||||
!(a.value === '<<' && ctx.schema.merge));
|
|
||||||
return items.some(pair => isEqual(pair.key, search));
|
return items.some(pair => isEqual(pair.key, search));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90203,6 +90345,7 @@ class Document {
|
||||||
logLevel: 'warn',
|
logLevel: 'warn',
|
||||||
prettyErrors: true,
|
prettyErrors: true,
|
||||||
strict: true,
|
strict: true,
|
||||||
|
stringKeys: false,
|
||||||
uniqueKeys: true,
|
uniqueKeys: true,
|
||||||
version: '1.2'
|
version: '1.2'
|
||||||
}, options);
|
}, options);
|
||||||
|
|
@ -90426,7 +90569,7 @@ class Document {
|
||||||
this.directives.yaml.version = '1.1';
|
this.directives.yaml.version = '1.1';
|
||||||
else
|
else
|
||||||
this.directives = new directives.Directives({ version: '1.1' });
|
this.directives = new directives.Directives({ version: '1.1' });
|
||||||
opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
|
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
||||||
break;
|
break;
|
||||||
case '1.2':
|
case '1.2':
|
||||||
case 'next':
|
case 'next':
|
||||||
|
|
@ -90434,7 +90577,7 @@ class Document {
|
||||||
this.directives.yaml.version = version;
|
this.directives.yaml.version = version;
|
||||||
else
|
else
|
||||||
this.directives = new directives.Directives({ version });
|
this.directives = new directives.Directives({ version });
|
||||||
opt = { merge: false, resolveKnownTags: true, schema: 'core' };
|
opt = { resolveKnownTags: true, schema: 'core' };
|
||||||
break;
|
break;
|
||||||
case null:
|
case null:
|
||||||
if (this.directives)
|
if (this.directives)
|
||||||
|
|
@ -91777,24 +91920,17 @@ exports.YAMLSeq = YAMLSeq;
|
||||||
|
|
||||||
|
|
||||||
var log = __nccwpck_require__(7249);
|
var log = __nccwpck_require__(7249);
|
||||||
|
var merge = __nccwpck_require__(452);
|
||||||
var stringify = __nccwpck_require__(2148);
|
var stringify = __nccwpck_require__(2148);
|
||||||
var identity = __nccwpck_require__(1127);
|
var identity = __nccwpck_require__(1127);
|
||||||
var Scalar = __nccwpck_require__(3301);
|
|
||||||
var toJS = __nccwpck_require__(6424);
|
var toJS = __nccwpck_require__(6424);
|
||||||
|
|
||||||
const MERGE_KEY = '<<';
|
|
||||||
function addPairToJSMap(ctx, map, { key, value }) {
|
function addPairToJSMap(ctx, map, { key, value }) {
|
||||||
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
if (identity.isNode(key) && key.addToJSMap)
|
||||||
value = identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
key.addToJSMap(ctx, map, value);
|
||||||
if (identity.isSeq(value))
|
// TODO: Should drop this special case for bare << handling
|
||||||
for (const it of value.items)
|
else if (merge.isMergeKey(ctx, key))
|
||||||
mergeToJSMap(ctx, map, it);
|
merge.addMergeToJSMap(ctx, map, value);
|
||||||
else if (Array.isArray(value))
|
|
||||||
for (const it of value)
|
|
||||||
mergeToJSMap(ctx, map, it);
|
|
||||||
else
|
|
||||||
mergeToJSMap(ctx, map, value);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
const jsKey = toJS.toJS(key, '', ctx);
|
const jsKey = toJS.toJS(key, '', ctx);
|
||||||
if (map instanceof Map) {
|
if (map instanceof Map) {
|
||||||
|
|
@ -91819,41 +91955,6 @@ function addPairToJSMap(ctx, map, { key, value }) {
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
||||||
(identity.isScalar(key) &&
|
|
||||||
key.value === MERGE_KEY &&
|
|
||||||
(!key.type || key.type === Scalar.Scalar.PLAIN));
|
|
||||||
// If the value associated with a merge key is a single mapping node, each of
|
|
||||||
// its key/value pairs is inserted into the current mapping, unless the key
|
|
||||||
// already exists in it. If the value associated with the merge key is a
|
|
||||||
// sequence, then this sequence is expected to contain mapping nodes and each
|
|
||||||
// of these nodes is merged in turn according to its order in the sequence.
|
|
||||||
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
||||||
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
||||||
function mergeToJSMap(ctx, map, value) {
|
|
||||||
const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
||||||
if (!identity.isMap(source))
|
|
||||||
throw new Error('Merge sources must be maps or map aliases');
|
|
||||||
const srcMap = source.toJSON(null, ctx, Map);
|
|
||||||
for (const [key, value] of srcMap) {
|
|
||||||
if (map instanceof Map) {
|
|
||||||
if (!map.has(key))
|
|
||||||
map.set(key, value);
|
|
||||||
}
|
|
||||||
else if (map instanceof Set) {
|
|
||||||
map.add(key);
|
|
||||||
}
|
|
||||||
else if (!Object.prototype.hasOwnProperty.call(map, key)) {
|
|
||||||
Object.defineProperty(map, key, {
|
|
||||||
value,
|
|
||||||
writable: true,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
function stringifyKey(key, jsKey, ctx) {
|
function stringifyKey(key, jsKey, ctx) {
|
||||||
if (jsKey === null)
|
if (jsKey === null)
|
||||||
return '';
|
return '';
|
||||||
|
|
@ -94268,6 +94369,7 @@ var composer = __nccwpck_require__(9984);
|
||||||
var Document = __nccwpck_require__(3021);
|
var Document = __nccwpck_require__(3021);
|
||||||
var errors = __nccwpck_require__(1464);
|
var errors = __nccwpck_require__(1464);
|
||||||
var log = __nccwpck_require__(7249);
|
var log = __nccwpck_require__(7249);
|
||||||
|
var identity = __nccwpck_require__(1127);
|
||||||
var lineCounter = __nccwpck_require__(6628);
|
var lineCounter = __nccwpck_require__(6628);
|
||||||
var parser = __nccwpck_require__(3456);
|
var parser = __nccwpck_require__(3456);
|
||||||
|
|
||||||
|
|
@ -94359,6 +94461,8 @@ function stringify(value, replacer, options) {
|
||||||
if (!keepUndefined)
|
if (!keepUndefined)
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (identity.isDocument(value) && !_replacer)
|
||||||
|
return value.toString(options);
|
||||||
return new Document.Document(value, _replacer, options).toString(options);
|
return new Document.Document(value, _replacer, options).toString(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -94390,10 +94494,9 @@ class Schema {
|
||||||
: compat
|
: compat
|
||||||
? tags.getTags(null, compat)
|
? tags.getTags(null, compat)
|
||||||
: null;
|
: null;
|
||||||
this.merge = !!merge;
|
|
||||||
this.name = (typeof schema === 'string' && schema) || 'core';
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
||||||
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
||||||
this.tags = tags.getTags(customTags, this.name);
|
this.tags = tags.getTags(customTags, this.name, merge);
|
||||||
this.toStringOptions = toStringDefaults ?? null;
|
this.toStringOptions = toStringDefaults ?? null;
|
||||||
Object.defineProperty(this, identity.MAP, { value: map.map });
|
Object.defineProperty(this, identity.MAP, { value: map.map });
|
||||||
Object.defineProperty(this, identity.SCALAR, { value: string.string });
|
Object.defineProperty(this, identity.SCALAR, { value: string.string });
|
||||||
|
|
@ -94776,6 +94879,7 @@ var int = __nccwpck_require__(9874);
|
||||||
var schema = __nccwpck_require__(896);
|
var schema = __nccwpck_require__(896);
|
||||||
var schema$1 = __nccwpck_require__(3559);
|
var schema$1 = __nccwpck_require__(3559);
|
||||||
var binary = __nccwpck_require__(6083);
|
var binary = __nccwpck_require__(6083);
|
||||||
|
var merge = __nccwpck_require__(452);
|
||||||
var omap = __nccwpck_require__(303);
|
var omap = __nccwpck_require__(303);
|
||||||
var pairs = __nccwpck_require__(8385);
|
var pairs = __nccwpck_require__(8385);
|
||||||
var schema$2 = __nccwpck_require__(8294);
|
var schema$2 = __nccwpck_require__(8294);
|
||||||
|
|
@ -94801,6 +94905,7 @@ const tagsByName = {
|
||||||
intOct: int.intOct,
|
intOct: int.intOct,
|
||||||
intTime: timestamp.intTime,
|
intTime: timestamp.intTime,
|
||||||
map: map.map,
|
map: map.map,
|
||||||
|
merge: merge.merge,
|
||||||
null: _null.nullTag,
|
null: _null.nullTag,
|
||||||
omap: omap.omap,
|
omap: omap.omap,
|
||||||
pairs: pairs.pairs,
|
pairs: pairs.pairs,
|
||||||
|
|
@ -94810,13 +94915,20 @@ const tagsByName = {
|
||||||
};
|
};
|
||||||
const coreKnownTags = {
|
const coreKnownTags = {
|
||||||
'tag:yaml.org,2002:binary': binary.binary,
|
'tag:yaml.org,2002:binary': binary.binary,
|
||||||
|
'tag:yaml.org,2002:merge': merge.merge,
|
||||||
'tag:yaml.org,2002:omap': omap.omap,
|
'tag:yaml.org,2002:omap': omap.omap,
|
||||||
'tag:yaml.org,2002:pairs': pairs.pairs,
|
'tag:yaml.org,2002:pairs': pairs.pairs,
|
||||||
'tag:yaml.org,2002:set': set.set,
|
'tag:yaml.org,2002:set': set.set,
|
||||||
'tag:yaml.org,2002:timestamp': timestamp.timestamp
|
'tag:yaml.org,2002:timestamp': timestamp.timestamp
|
||||||
};
|
};
|
||||||
function getTags(customTags, schemaName) {
|
function getTags(customTags, schemaName, addMergeTag) {
|
||||||
let tags = schemas.get(schemaName);
|
const schemaTags = schemas.get(schemaName);
|
||||||
|
if (schemaTags && !customTags) {
|
||||||
|
return addMergeTag && !schemaTags.includes(merge.merge)
|
||||||
|
? schemaTags.concat(merge.merge)
|
||||||
|
: schemaTags.slice();
|
||||||
|
}
|
||||||
|
let tags = schemaTags;
|
||||||
if (!tags) {
|
if (!tags) {
|
||||||
if (Array.isArray(customTags))
|
if (Array.isArray(customTags))
|
||||||
tags = [];
|
tags = [];
|
||||||
|
|
@ -94835,17 +94947,21 @@ function getTags(customTags, schemaName) {
|
||||||
else if (typeof customTags === 'function') {
|
else if (typeof customTags === 'function') {
|
||||||
tags = customTags(tags.slice());
|
tags = customTags(tags.slice());
|
||||||
}
|
}
|
||||||
return tags.map(tag => {
|
if (addMergeTag)
|
||||||
if (typeof tag !== 'string')
|
tags = tags.concat(merge.merge);
|
||||||
return tag;
|
return tags.reduce((tags, tag) => {
|
||||||
const tagObj = tagsByName[tag];
|
const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
|
||||||
if (tagObj)
|
if (!tagObj) {
|
||||||
return tagObj;
|
const tagName = JSON.stringify(tag);
|
||||||
const keys = Object.keys(tagsByName)
|
const keys = Object.keys(tagsByName)
|
||||||
.map(key => JSON.stringify(key))
|
.map(key => JSON.stringify(key))
|
||||||
.join(', ');
|
.join(', ');
|
||||||
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
||||||
});
|
}
|
||||||
|
if (!tags.includes(tagObj))
|
||||||
|
tags.push(tagObj);
|
||||||
|
return tags;
|
||||||
|
}, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.coreKnownTags = coreKnownTags;
|
exports.coreKnownTags = coreKnownTags;
|
||||||
|
|
@ -95107,6 +95223,82 @@ exports.intHex = intHex;
|
||||||
exports.intOct = intOct;
|
exports.intOct = intOct;
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 452:
|
||||||
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
var identity = __nccwpck_require__(1127);
|
||||||
|
var Scalar = __nccwpck_require__(3301);
|
||||||
|
|
||||||
|
// If the value associated with a merge key is a single mapping node, each of
|
||||||
|
// its key/value pairs is inserted into the current mapping, unless the key
|
||||||
|
// already exists in it. If the value associated with the merge key is a
|
||||||
|
// sequence, then this sequence is expected to contain mapping nodes and each
|
||||||
|
// of these nodes is merged in turn according to its order in the sequence.
|
||||||
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
||||||
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
||||||
|
const MERGE_KEY = '<<';
|
||||||
|
const merge = {
|
||||||
|
identify: value => value === MERGE_KEY ||
|
||||||
|
(typeof value === 'symbol' && value.description === MERGE_KEY),
|
||||||
|
default: 'key',
|
||||||
|
tag: 'tag:yaml.org,2002:merge',
|
||||||
|
test: /^<<$/,
|
||||||
|
resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {
|
||||||
|
addToJSMap: addMergeToJSMap
|
||||||
|
}),
|
||||||
|
stringify: () => MERGE_KEY
|
||||||
|
};
|
||||||
|
const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
||||||
|
(identity.isScalar(key) &&
|
||||||
|
(!key.type || key.type === Scalar.Scalar.PLAIN) &&
|
||||||
|
merge.identify(key.value))) &&
|
||||||
|
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
|
||||||
|
function addMergeToJSMap(ctx, map, value) {
|
||||||
|
value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
||||||
|
if (identity.isSeq(value))
|
||||||
|
for (const it of value.items)
|
||||||
|
mergeValue(ctx, map, it);
|
||||||
|
else if (Array.isArray(value))
|
||||||
|
for (const it of value)
|
||||||
|
mergeValue(ctx, map, it);
|
||||||
|
else
|
||||||
|
mergeValue(ctx, map, value);
|
||||||
|
}
|
||||||
|
function mergeValue(ctx, map, value) {
|
||||||
|
const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
||||||
|
if (!identity.isMap(source))
|
||||||
|
throw new Error('Merge sources must be maps or map aliases');
|
||||||
|
const srcMap = source.toJSON(null, ctx, Map);
|
||||||
|
for (const [key, value] of srcMap) {
|
||||||
|
if (map instanceof Map) {
|
||||||
|
if (!map.has(key))
|
||||||
|
map.set(key, value);
|
||||||
|
}
|
||||||
|
else if (map instanceof Set) {
|
||||||
|
map.add(key);
|
||||||
|
}
|
||||||
|
else if (!Object.prototype.hasOwnProperty.call(map, key)) {
|
||||||
|
Object.defineProperty(map, key, {
|
||||||
|
value,
|
||||||
|
writable: true,
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.addMergeToJSMap = addMergeToJSMap;
|
||||||
|
exports.isMergeKey = isMergeKey;
|
||||||
|
exports.merge = merge;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 303:
|
/***/ 303:
|
||||||
|
|
@ -95298,6 +95490,7 @@ var binary = __nccwpck_require__(6083);
|
||||||
var bool = __nccwpck_require__(8398);
|
var bool = __nccwpck_require__(8398);
|
||||||
var float = __nccwpck_require__(5782);
|
var float = __nccwpck_require__(5782);
|
||||||
var int = __nccwpck_require__(873);
|
var int = __nccwpck_require__(873);
|
||||||
|
var merge = __nccwpck_require__(452);
|
||||||
var omap = __nccwpck_require__(303);
|
var omap = __nccwpck_require__(303);
|
||||||
var pairs = __nccwpck_require__(8385);
|
var pairs = __nccwpck_require__(8385);
|
||||||
var set = __nccwpck_require__(1528);
|
var set = __nccwpck_require__(1528);
|
||||||
|
|
@ -95318,6 +95511,7 @@ const schema = [
|
||||||
float.floatExp,
|
float.floatExp,
|
||||||
float.float,
|
float.float,
|
||||||
binary.binary,
|
binary.binary,
|
||||||
|
merge.merge,
|
||||||
omap.omap,
|
omap.omap,
|
||||||
pairs.pairs,
|
pairs.pairs,
|
||||||
set.set,
|
set.set,
|
||||||
|
|
@ -95769,7 +95963,12 @@ function getTagObject(tags, item) {
|
||||||
let obj;
|
let obj;
|
||||||
if (identity.isScalar(item)) {
|
if (identity.isScalar(item)) {
|
||||||
obj = item.value;
|
obj = item.value;
|
||||||
const match = tags.filter(t => t.identify?.(obj));
|
let match = tags.filter(t => t.identify?.(obj));
|
||||||
|
if (match.length > 1) {
|
||||||
|
const testMatch = match.filter(t => t.test);
|
||||||
|
if (testMatch.length > 0)
|
||||||
|
match = testMatch;
|
||||||
|
}
|
||||||
tagObj =
|
tagObj =
|
||||||
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
||||||
}
|
}
|
||||||
|
|
@ -97020,8 +97219,10 @@ async function downloadBazelisk() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let filename = `bazelisk-${platform}-${arch}`
|
let filename = `bazelisk-${platform}-${arch}`
|
||||||
|
let toolname = 'bazel' // alias bazelisk as bazel
|
||||||
if (platform == 'windows') {
|
if (platform == 'windows') {
|
||||||
filename = `${filename}.exe`
|
filename = `${filename}.exe`
|
||||||
|
toolName = `${toolname}.exe`
|
||||||
}
|
}
|
||||||
|
|
||||||
const token = core.getInput('token')
|
const token = core.getInput('token')
|
||||||
|
|
@ -97051,7 +97252,7 @@ async function downloadBazelisk() {
|
||||||
|
|
||||||
core.debug('Adding to the cache...');
|
core.debug('Adding to the cache...');
|
||||||
fs.chmodSync(downloadPath, '755');
|
fs.chmodSync(downloadPath, '755');
|
||||||
const cachePath = await tc.cacheFile(downloadPath, 'bazel', 'bazelisk', version)
|
const cachePath = await tc.cacheFile(downloadPath, toolname, 'bazelisk', version)
|
||||||
core.debug(`Successfully cached bazelisk to ${cachePath}`)
|
core.debug(`Successfully cached bazelisk to ${cachePath}`)
|
||||||
|
|
||||||
return cachePath
|
return cachePath
|
||||||
|
|
|
||||||
2
dist/main/index.js.map
vendored
2
dist/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
419
dist/post/index.js
vendored
419
dist/post/index.js
vendored
|
|
@ -3121,7 +3121,11 @@ module.exports = v4;
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|
@ -3134,7 +3138,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
@ -3196,13 +3200,13 @@ class Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function escapeData(s) {
|
function escapeData(s) {
|
||||||
return utils_1.toCommandValue(s)
|
return (0, utils_1.toCommandValue)(s)
|
||||||
.replace(/%/g, '%25')
|
.replace(/%/g, '%25')
|
||||||
.replace(/\r/g, '%0D')
|
.replace(/\r/g, '%0D')
|
||||||
.replace(/\n/g, '%0A');
|
.replace(/\n/g, '%0A');
|
||||||
}
|
}
|
||||||
function escapeProperty(s) {
|
function escapeProperty(s) {
|
||||||
return utils_1.toCommandValue(s)
|
return (0, utils_1.toCommandValue)(s)
|
||||||
.replace(/%/g, '%25')
|
.replace(/%/g, '%25')
|
||||||
.replace(/\r/g, '%0D')
|
.replace(/\r/g, '%0D')
|
||||||
.replace(/\n/g, '%0A')
|
.replace(/\n/g, '%0A')
|
||||||
|
|
@ -3220,7 +3224,11 @@ function escapeProperty(s) {
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|
@ -3233,7 +3241,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
@ -3247,7 +3255,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
||||||
const command_1 = __nccwpck_require__(4914);
|
const command_1 = __nccwpck_require__(4914);
|
||||||
const file_command_1 = __nccwpck_require__(4753);
|
const file_command_1 = __nccwpck_require__(4753);
|
||||||
const utils_1 = __nccwpck_require__(302);
|
const utils_1 = __nccwpck_require__(302);
|
||||||
|
|
@ -3267,7 +3275,7 @@ var ExitCode;
|
||||||
* A code indicating that the action was a failure
|
* A code indicating that the action was a failure
|
||||||
*/
|
*/
|
||||||
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
||||||
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
})(ExitCode || (exports.ExitCode = ExitCode = {}));
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Variables
|
// Variables
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
|
@ -3278,13 +3286,13 @@ var ExitCode;
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
function exportVariable(name, val) {
|
function exportVariable(name, val) {
|
||||||
const convertedVal = utils_1.toCommandValue(val);
|
const convertedVal = (0, utils_1.toCommandValue)(val);
|
||||||
process.env[name] = convertedVal;
|
process.env[name] = convertedVal;
|
||||||
const filePath = process.env['GITHUB_ENV'] || '';
|
const filePath = process.env['GITHUB_ENV'] || '';
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
|
return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val));
|
||||||
}
|
}
|
||||||
command_1.issueCommand('set-env', { name }, convertedVal);
|
(0, command_1.issueCommand)('set-env', { name }, convertedVal);
|
||||||
}
|
}
|
||||||
exports.exportVariable = exportVariable;
|
exports.exportVariable = exportVariable;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3292,7 +3300,7 @@ exports.exportVariable = exportVariable;
|
||||||
* @param secret value of the secret
|
* @param secret value of the secret
|
||||||
*/
|
*/
|
||||||
function setSecret(secret) {
|
function setSecret(secret) {
|
||||||
command_1.issueCommand('add-mask', {}, secret);
|
(0, command_1.issueCommand)('add-mask', {}, secret);
|
||||||
}
|
}
|
||||||
exports.setSecret = setSecret;
|
exports.setSecret = setSecret;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3302,10 +3310,10 @@ exports.setSecret = setSecret;
|
||||||
function addPath(inputPath) {
|
function addPath(inputPath) {
|
||||||
const filePath = process.env['GITHUB_PATH'] || '';
|
const filePath = process.env['GITHUB_PATH'] || '';
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
file_command_1.issueFileCommand('PATH', inputPath);
|
(0, file_command_1.issueFileCommand)('PATH', inputPath);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
command_1.issueCommand('add-path', {}, inputPath);
|
(0, command_1.issueCommand)('add-path', {}, inputPath);
|
||||||
}
|
}
|
||||||
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
||||||
}
|
}
|
||||||
|
|
@ -3380,10 +3388,10 @@ exports.getBooleanInput = getBooleanInput;
|
||||||
function setOutput(name, value) {
|
function setOutput(name, value) {
|
||||||
const filePath = process.env['GITHUB_OUTPUT'] || '';
|
const filePath = process.env['GITHUB_OUTPUT'] || '';
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
|
return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value));
|
||||||
}
|
}
|
||||||
process.stdout.write(os.EOL);
|
process.stdout.write(os.EOL);
|
||||||
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
|
(0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value));
|
||||||
}
|
}
|
||||||
exports.setOutput = setOutput;
|
exports.setOutput = setOutput;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3392,7 +3400,7 @@ exports.setOutput = setOutput;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function setCommandEcho(enabled) {
|
function setCommandEcho(enabled) {
|
||||||
command_1.issue('echo', enabled ? 'on' : 'off');
|
(0, command_1.issue)('echo', enabled ? 'on' : 'off');
|
||||||
}
|
}
|
||||||
exports.setCommandEcho = setCommandEcho;
|
exports.setCommandEcho = setCommandEcho;
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
|
@ -3423,7 +3431,7 @@ exports.isDebug = isDebug;
|
||||||
* @param message debug message
|
* @param message debug message
|
||||||
*/
|
*/
|
||||||
function debug(message) {
|
function debug(message) {
|
||||||
command_1.issueCommand('debug', {}, message);
|
(0, command_1.issueCommand)('debug', {}, message);
|
||||||
}
|
}
|
||||||
exports.debug = debug;
|
exports.debug = debug;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3432,7 +3440,7 @@ exports.debug = debug;
|
||||||
* @param properties optional properties to add to the annotation.
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function error(message, properties = {}) {
|
function error(message, properties = {}) {
|
||||||
command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
(0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.error = error;
|
exports.error = error;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3441,7 +3449,7 @@ exports.error = error;
|
||||||
* @param properties optional properties to add to the annotation.
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function warning(message, properties = {}) {
|
function warning(message, properties = {}) {
|
||||||
command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
(0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.warning = warning;
|
exports.warning = warning;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3450,7 +3458,7 @@ exports.warning = warning;
|
||||||
* @param properties optional properties to add to the annotation.
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function notice(message, properties = {}) {
|
function notice(message, properties = {}) {
|
||||||
command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
(0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.notice = notice;
|
exports.notice = notice;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3469,14 +3477,14 @@ exports.info = info;
|
||||||
* @param name The name of the output group
|
* @param name The name of the output group
|
||||||
*/
|
*/
|
||||||
function startGroup(name) {
|
function startGroup(name) {
|
||||||
command_1.issue('group', name);
|
(0, command_1.issue)('group', name);
|
||||||
}
|
}
|
||||||
exports.startGroup = startGroup;
|
exports.startGroup = startGroup;
|
||||||
/**
|
/**
|
||||||
* End an output group.
|
* End an output group.
|
||||||
*/
|
*/
|
||||||
function endGroup() {
|
function endGroup() {
|
||||||
command_1.issue('endgroup');
|
(0, command_1.issue)('endgroup');
|
||||||
}
|
}
|
||||||
exports.endGroup = endGroup;
|
exports.endGroup = endGroup;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3514,9 +3522,9 @@ exports.group = group;
|
||||||
function saveState(name, value) {
|
function saveState(name, value) {
|
||||||
const filePath = process.env['GITHUB_STATE'] || '';
|
const filePath = process.env['GITHUB_STATE'] || '';
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
|
return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value));
|
||||||
}
|
}
|
||||||
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
|
(0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value));
|
||||||
}
|
}
|
||||||
exports.saveState = saveState;
|
exports.saveState = saveState;
|
||||||
/**
|
/**
|
||||||
|
|
@ -3552,6 +3560,10 @@ var path_utils_1 = __nccwpck_require__(1976);
|
||||||
Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
|
Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
|
||||||
Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
|
Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
|
||||||
Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
|
Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
|
||||||
|
/**
|
||||||
|
* Platform utilities exports
|
||||||
|
*/
|
||||||
|
exports.platform = __importStar(__nccwpck_require__(8968));
|
||||||
//# sourceMappingURL=core.js.map
|
//# sourceMappingURL=core.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
@ -3564,7 +3576,11 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct
|
||||||
// For internal use, subject to change.
|
// For internal use, subject to change.
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|
@ -3577,7 +3593,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
@ -3585,9 +3601,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
|
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
|
||||||
// We use any as a valid input type
|
// We use any as a valid input type
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
const crypto = __importStar(__nccwpck_require__(6982));
|
||||||
const fs = __importStar(__nccwpck_require__(9896));
|
const fs = __importStar(__nccwpck_require__(9896));
|
||||||
const os = __importStar(__nccwpck_require__(857));
|
const os = __importStar(__nccwpck_require__(857));
|
||||||
const uuid_1 = __nccwpck_require__(2048);
|
|
||||||
const utils_1 = __nccwpck_require__(302);
|
const utils_1 = __nccwpck_require__(302);
|
||||||
function issueFileCommand(command, message) {
|
function issueFileCommand(command, message) {
|
||||||
const filePath = process.env[`GITHUB_${command}`];
|
const filePath = process.env[`GITHUB_${command}`];
|
||||||
|
|
@ -3597,14 +3613,14 @@ function issueFileCommand(command, message) {
|
||||||
if (!fs.existsSync(filePath)) {
|
if (!fs.existsSync(filePath)) {
|
||||||
throw new Error(`Missing file at path: ${filePath}`);
|
throw new Error(`Missing file at path: ${filePath}`);
|
||||||
}
|
}
|
||||||
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
|
fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, {
|
||||||
encoding: 'utf8'
|
encoding: 'utf8'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.issueFileCommand = issueFileCommand;
|
exports.issueFileCommand = issueFileCommand;
|
||||||
function prepareKeyValueMessage(key, value) {
|
function prepareKeyValueMessage(key, value) {
|
||||||
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
|
const delimiter = `ghadelimiter_${crypto.randomUUID()}`;
|
||||||
const convertedValue = utils_1.toCommandValue(value);
|
const convertedValue = (0, utils_1.toCommandValue)(value);
|
||||||
// These should realistically never happen, but just in case someone finds a
|
// These should realistically never happen, but just in case someone finds a
|
||||||
// way to exploit uuid generation let's not allow keys or values that contain
|
// way to exploit uuid generation let's not allow keys or values that contain
|
||||||
// the delimiter.
|
// the delimiter.
|
||||||
|
|
@ -3689,9 +3705,9 @@ class OidcClient {
|
||||||
const encodedAudience = encodeURIComponent(audience);
|
const encodedAudience = encodeURIComponent(audience);
|
||||||
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
||||||
}
|
}
|
||||||
core_1.debug(`ID token url is ${id_token_url}`);
|
(0, core_1.debug)(`ID token url is ${id_token_url}`);
|
||||||
const id_token = yield OidcClient.getCall(id_token_url);
|
const id_token = yield OidcClient.getCall(id_token_url);
|
||||||
core_1.setSecret(id_token);
|
(0, core_1.setSecret)(id_token);
|
||||||
return id_token;
|
return id_token;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|
@ -3712,7 +3728,11 @@ exports.OidcClient = OidcClient;
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|
@ -3725,7 +3745,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
@ -3770,6 +3790,107 @@ exports.toPlatformPath = toPlatformPath;
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 8968:
|
||||||
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0;
|
||||||
|
const os_1 = __importDefault(__nccwpck_require__(857));
|
||||||
|
const exec = __importStar(__nccwpck_require__(5236));
|
||||||
|
const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
name: name.trim(),
|
||||||
|
version: version.trim()
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c, _d;
|
||||||
|
const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';
|
||||||
|
const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
version
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
|
const [name, version] = stdout.trim().split('\n');
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
version
|
||||||
|
};
|
||||||
|
});
|
||||||
|
exports.platform = os_1.default.platform();
|
||||||
|
exports.arch = os_1.default.arch();
|
||||||
|
exports.isWindows = exports.platform === 'win32';
|
||||||
|
exports.isMacOS = exports.platform === 'darwin';
|
||||||
|
exports.isLinux = exports.platform === 'linux';
|
||||||
|
function getDetails() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return Object.assign(Object.assign({}, (yield (exports.isWindows
|
||||||
|
? getWindowsInfo()
|
||||||
|
: exports.isMacOS
|
||||||
|
? getMacOsInfo()
|
||||||
|
: getLinuxInfo()))), { platform: exports.platform,
|
||||||
|
arch: exports.arch,
|
||||||
|
isWindows: exports.isWindows,
|
||||||
|
isMacOS: exports.isMacOS,
|
||||||
|
isLinux: exports.isLinux });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.getDetails = getDetails;
|
||||||
|
//# sourceMappingURL=platform.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ 1847:
|
/***/ 1847:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
|
@ -87606,6 +87727,7 @@ function composeDoc(options, directives, { offset, start, value, end }, onError)
|
||||||
const opts = Object.assign({ _directives: directives }, options);
|
const opts = Object.assign({ _directives: directives }, options);
|
||||||
const doc = new Document.Document(undefined, opts);
|
const doc = new Document.Document(undefined, opts);
|
||||||
const ctx = {
|
const ctx = {
|
||||||
|
atKey: false,
|
||||||
atRoot: true,
|
atRoot: true,
|
||||||
directives: doc.directives,
|
directives: doc.directives,
|
||||||
options: doc.options,
|
options: doc.options,
|
||||||
|
|
@ -87650,6 +87772,7 @@ exports.composeDoc = composeDoc;
|
||||||
|
|
||||||
|
|
||||||
var Alias = __nccwpck_require__(4065);
|
var Alias = __nccwpck_require__(4065);
|
||||||
|
var identity = __nccwpck_require__(1127);
|
||||||
var composeCollection = __nccwpck_require__(7349);
|
var composeCollection = __nccwpck_require__(7349);
|
||||||
var composeScalar = __nccwpck_require__(5413);
|
var composeScalar = __nccwpck_require__(5413);
|
||||||
var resolveEnd = __nccwpck_require__(7788);
|
var resolveEnd = __nccwpck_require__(7788);
|
||||||
|
|
@ -87657,6 +87780,7 @@ var utilEmptyScalarPosition = __nccwpck_require__(2599);
|
||||||
|
|
||||||
const CN = { composeNode, composeEmptyNode };
|
const CN = { composeNode, composeEmptyNode };
|
||||||
function composeNode(ctx, token, props, onError) {
|
function composeNode(ctx, token, props, onError) {
|
||||||
|
const atKey = ctx.atKey;
|
||||||
const { spaceBefore, comment, anchor, tag } = props;
|
const { spaceBefore, comment, anchor, tag } = props;
|
||||||
let node;
|
let node;
|
||||||
let isSrcToken = true;
|
let isSrcToken = true;
|
||||||
|
|
@ -87692,6 +87816,14 @@ function composeNode(ctx, token, props, onError) {
|
||||||
}
|
}
|
||||||
if (anchor && node.anchor === '')
|
if (anchor && node.anchor === '')
|
||||||
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
||||||
|
if (atKey &&
|
||||||
|
ctx.options.stringKeys &&
|
||||||
|
(!identity.isScalar(node) ||
|
||||||
|
typeof node.value !== 'string' ||
|
||||||
|
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
|
||||||
|
const msg = 'With stringKeys, all keys must be strings';
|
||||||
|
onError(tag ?? token, 'NON_STRING_KEY', msg);
|
||||||
|
}
|
||||||
if (spaceBefore)
|
if (spaceBefore)
|
||||||
node.spaceBefore = true;
|
node.spaceBefore = true;
|
||||||
if (comment) {
|
if (comment) {
|
||||||
|
|
@ -87764,11 +87896,16 @@ function composeScalar(ctx, token, tagToken, onError) {
|
||||||
const tagName = tagToken
|
const tagName = tagToken
|
||||||
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
||||||
: null;
|
: null;
|
||||||
const tag = tagToken && tagName
|
let tag;
|
||||||
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
if (ctx.options.stringKeys && ctx.atKey) {
|
||||||
: token.type === 'scalar'
|
tag = ctx.schema[identity.SCALAR];
|
||||||
? findScalarTagByTest(ctx, value, token, onError)
|
}
|
||||||
: ctx.schema[identity.SCALAR];
|
else if (tagName)
|
||||||
|
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
||||||
|
else if (token.type === 'scalar')
|
||||||
|
tag = findScalarTagByTest(ctx, value, token, onError);
|
||||||
|
else
|
||||||
|
tag = ctx.schema[identity.SCALAR];
|
||||||
let scalar;
|
let scalar;
|
||||||
try {
|
try {
|
||||||
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
||||||
|
|
@ -87816,8 +87953,9 @@ function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
||||||
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
||||||
return schema[identity.SCALAR];
|
return schema[identity.SCALAR];
|
||||||
}
|
}
|
||||||
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
||||||
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[identity.SCALAR];
|
const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
|
||||||
|
tag.test?.test(value)) || schema[identity.SCALAR];
|
||||||
if (schema.compat) {
|
if (schema.compat) {
|
||||||
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
||||||
schema[identity.SCALAR];
|
schema[identity.SCALAR];
|
||||||
|
|
@ -88123,12 +88261,14 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, ta
|
||||||
onError(offset, 'BAD_INDENT', startColMsg);
|
onError(offset, 'BAD_INDENT', startColMsg);
|
||||||
}
|
}
|
||||||
// key value
|
// key value
|
||||||
|
ctx.atKey = true;
|
||||||
const keyStart = keyProps.end;
|
const keyStart = keyProps.end;
|
||||||
const keyNode = key
|
const keyNode = key
|
||||||
? composeNode(ctx, key, keyProps, onError)
|
? composeNode(ctx, key, keyProps, onError)
|
||||||
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
||||||
if (ctx.schema.compat)
|
if (ctx.schema.compat)
|
||||||
utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
|
||||||
|
ctx.atKey = false;
|
||||||
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
||||||
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
||||||
// value properties
|
// value properties
|
||||||
|
|
@ -88411,6 +88551,8 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, ta
|
||||||
const seq = new NodeClass(ctx.schema);
|
const seq = new NodeClass(ctx.schema);
|
||||||
if (ctx.atRoot)
|
if (ctx.atRoot)
|
||||||
ctx.atRoot = false;
|
ctx.atRoot = false;
|
||||||
|
if (ctx.atKey)
|
||||||
|
ctx.atKey = false;
|
||||||
let offset = bs.offset;
|
let offset = bs.offset;
|
||||||
let commentEnd = null;
|
let commentEnd = null;
|
||||||
for (const { start, value } of bs.items) {
|
for (const { start, value } of bs.items) {
|
||||||
|
|
@ -88526,6 +88668,8 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
|
||||||
const atRoot = ctx.atRoot;
|
const atRoot = ctx.atRoot;
|
||||||
if (atRoot)
|
if (atRoot)
|
||||||
ctx.atRoot = false;
|
ctx.atRoot = false;
|
||||||
|
if (ctx.atKey)
|
||||||
|
ctx.atKey = false;
|
||||||
let offset = fc.offset + fc.start.source.length;
|
let offset = fc.offset + fc.start.source.length;
|
||||||
for (let i = 0; i < fc.items.length; ++i) {
|
for (let i = 0; i < fc.items.length; ++i) {
|
||||||
const collItem = fc.items[i];
|
const collItem = fc.items[i];
|
||||||
|
|
@ -88605,12 +88749,14 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
|
||||||
else {
|
else {
|
||||||
// item is a key+value pair
|
// item is a key+value pair
|
||||||
// key value
|
// key value
|
||||||
|
ctx.atKey = true;
|
||||||
const keyStart = props.end;
|
const keyStart = props.end;
|
||||||
const keyNode = key
|
const keyNode = key
|
||||||
? composeNode(ctx, key, props, onError)
|
? composeNode(ctx, key, props, onError)
|
||||||
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
||||||
if (isBlock(key))
|
if (isBlock(key))
|
||||||
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
||||||
|
ctx.atKey = false;
|
||||||
// value properties
|
// value properties
|
||||||
const valueProps = resolveProps.resolveProps(sep ?? [], {
|
const valueProps = resolveProps.resolveProps(sep ?? [], {
|
||||||
flow: fcName,
|
flow: fcName,
|
||||||
|
|
@ -89224,11 +89370,7 @@ function mapIncludes(ctx, items, search) {
|
||||||
return false;
|
return false;
|
||||||
const isEqual = typeof uniqueKeys === 'function'
|
const isEqual = typeof uniqueKeys === 'function'
|
||||||
? uniqueKeys
|
? uniqueKeys
|
||||||
: (a, b) => a === b ||
|
: (a, b) => a === b || (identity.isScalar(a) && identity.isScalar(b) && a.value === b.value);
|
||||||
(identity.isScalar(a) &&
|
|
||||||
identity.isScalar(b) &&
|
|
||||||
a.value === b.value &&
|
|
||||||
!(a.value === '<<' && ctx.schema.merge));
|
|
||||||
return items.some(pair => isEqual(pair.key, search));
|
return items.some(pair => isEqual(pair.key, search));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89280,6 +89422,7 @@ class Document {
|
||||||
logLevel: 'warn',
|
logLevel: 'warn',
|
||||||
prettyErrors: true,
|
prettyErrors: true,
|
||||||
strict: true,
|
strict: true,
|
||||||
|
stringKeys: false,
|
||||||
uniqueKeys: true,
|
uniqueKeys: true,
|
||||||
version: '1.2'
|
version: '1.2'
|
||||||
}, options);
|
}, options);
|
||||||
|
|
@ -89503,7 +89646,7 @@ class Document {
|
||||||
this.directives.yaml.version = '1.1';
|
this.directives.yaml.version = '1.1';
|
||||||
else
|
else
|
||||||
this.directives = new directives.Directives({ version: '1.1' });
|
this.directives = new directives.Directives({ version: '1.1' });
|
||||||
opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
|
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
||||||
break;
|
break;
|
||||||
case '1.2':
|
case '1.2':
|
||||||
case 'next':
|
case 'next':
|
||||||
|
|
@ -89511,7 +89654,7 @@ class Document {
|
||||||
this.directives.yaml.version = version;
|
this.directives.yaml.version = version;
|
||||||
else
|
else
|
||||||
this.directives = new directives.Directives({ version });
|
this.directives = new directives.Directives({ version });
|
||||||
opt = { merge: false, resolveKnownTags: true, schema: 'core' };
|
opt = { resolveKnownTags: true, schema: 'core' };
|
||||||
break;
|
break;
|
||||||
case null:
|
case null:
|
||||||
if (this.directives)
|
if (this.directives)
|
||||||
|
|
@ -90854,24 +90997,17 @@ exports.YAMLSeq = YAMLSeq;
|
||||||
|
|
||||||
|
|
||||||
var log = __nccwpck_require__(7249);
|
var log = __nccwpck_require__(7249);
|
||||||
|
var merge = __nccwpck_require__(452);
|
||||||
var stringify = __nccwpck_require__(2148);
|
var stringify = __nccwpck_require__(2148);
|
||||||
var identity = __nccwpck_require__(1127);
|
var identity = __nccwpck_require__(1127);
|
||||||
var Scalar = __nccwpck_require__(3301);
|
|
||||||
var toJS = __nccwpck_require__(6424);
|
var toJS = __nccwpck_require__(6424);
|
||||||
|
|
||||||
const MERGE_KEY = '<<';
|
|
||||||
function addPairToJSMap(ctx, map, { key, value }) {
|
function addPairToJSMap(ctx, map, { key, value }) {
|
||||||
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
if (identity.isNode(key) && key.addToJSMap)
|
||||||
value = identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
key.addToJSMap(ctx, map, value);
|
||||||
if (identity.isSeq(value))
|
// TODO: Should drop this special case for bare << handling
|
||||||
for (const it of value.items)
|
else if (merge.isMergeKey(ctx, key))
|
||||||
mergeToJSMap(ctx, map, it);
|
merge.addMergeToJSMap(ctx, map, value);
|
||||||
else if (Array.isArray(value))
|
|
||||||
for (const it of value)
|
|
||||||
mergeToJSMap(ctx, map, it);
|
|
||||||
else
|
|
||||||
mergeToJSMap(ctx, map, value);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
const jsKey = toJS.toJS(key, '', ctx);
|
const jsKey = toJS.toJS(key, '', ctx);
|
||||||
if (map instanceof Map) {
|
if (map instanceof Map) {
|
||||||
|
|
@ -90896,41 +91032,6 @@ function addPairToJSMap(ctx, map, { key, value }) {
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
||||||
(identity.isScalar(key) &&
|
|
||||||
key.value === MERGE_KEY &&
|
|
||||||
(!key.type || key.type === Scalar.Scalar.PLAIN));
|
|
||||||
// If the value associated with a merge key is a single mapping node, each of
|
|
||||||
// its key/value pairs is inserted into the current mapping, unless the key
|
|
||||||
// already exists in it. If the value associated with the merge key is a
|
|
||||||
// sequence, then this sequence is expected to contain mapping nodes and each
|
|
||||||
// of these nodes is merged in turn according to its order in the sequence.
|
|
||||||
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
||||||
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
||||||
function mergeToJSMap(ctx, map, value) {
|
|
||||||
const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
||||||
if (!identity.isMap(source))
|
|
||||||
throw new Error('Merge sources must be maps or map aliases');
|
|
||||||
const srcMap = source.toJSON(null, ctx, Map);
|
|
||||||
for (const [key, value] of srcMap) {
|
|
||||||
if (map instanceof Map) {
|
|
||||||
if (!map.has(key))
|
|
||||||
map.set(key, value);
|
|
||||||
}
|
|
||||||
else if (map instanceof Set) {
|
|
||||||
map.add(key);
|
|
||||||
}
|
|
||||||
else if (!Object.prototype.hasOwnProperty.call(map, key)) {
|
|
||||||
Object.defineProperty(map, key, {
|
|
||||||
value,
|
|
||||||
writable: true,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
function stringifyKey(key, jsKey, ctx) {
|
function stringifyKey(key, jsKey, ctx) {
|
||||||
if (jsKey === null)
|
if (jsKey === null)
|
||||||
return '';
|
return '';
|
||||||
|
|
@ -93345,6 +93446,7 @@ var composer = __nccwpck_require__(9984);
|
||||||
var Document = __nccwpck_require__(3021);
|
var Document = __nccwpck_require__(3021);
|
||||||
var errors = __nccwpck_require__(1464);
|
var errors = __nccwpck_require__(1464);
|
||||||
var log = __nccwpck_require__(7249);
|
var log = __nccwpck_require__(7249);
|
||||||
|
var identity = __nccwpck_require__(1127);
|
||||||
var lineCounter = __nccwpck_require__(6628);
|
var lineCounter = __nccwpck_require__(6628);
|
||||||
var parser = __nccwpck_require__(3456);
|
var parser = __nccwpck_require__(3456);
|
||||||
|
|
||||||
|
|
@ -93436,6 +93538,8 @@ function stringify(value, replacer, options) {
|
||||||
if (!keepUndefined)
|
if (!keepUndefined)
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (identity.isDocument(value) && !_replacer)
|
||||||
|
return value.toString(options);
|
||||||
return new Document.Document(value, _replacer, options).toString(options);
|
return new Document.Document(value, _replacer, options).toString(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93467,10 +93571,9 @@ class Schema {
|
||||||
: compat
|
: compat
|
||||||
? tags.getTags(null, compat)
|
? tags.getTags(null, compat)
|
||||||
: null;
|
: null;
|
||||||
this.merge = !!merge;
|
|
||||||
this.name = (typeof schema === 'string' && schema) || 'core';
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
||||||
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
||||||
this.tags = tags.getTags(customTags, this.name);
|
this.tags = tags.getTags(customTags, this.name, merge);
|
||||||
this.toStringOptions = toStringDefaults ?? null;
|
this.toStringOptions = toStringDefaults ?? null;
|
||||||
Object.defineProperty(this, identity.MAP, { value: map.map });
|
Object.defineProperty(this, identity.MAP, { value: map.map });
|
||||||
Object.defineProperty(this, identity.SCALAR, { value: string.string });
|
Object.defineProperty(this, identity.SCALAR, { value: string.string });
|
||||||
|
|
@ -93853,6 +93956,7 @@ var int = __nccwpck_require__(9874);
|
||||||
var schema = __nccwpck_require__(896);
|
var schema = __nccwpck_require__(896);
|
||||||
var schema$1 = __nccwpck_require__(3559);
|
var schema$1 = __nccwpck_require__(3559);
|
||||||
var binary = __nccwpck_require__(6083);
|
var binary = __nccwpck_require__(6083);
|
||||||
|
var merge = __nccwpck_require__(452);
|
||||||
var omap = __nccwpck_require__(303);
|
var omap = __nccwpck_require__(303);
|
||||||
var pairs = __nccwpck_require__(8385);
|
var pairs = __nccwpck_require__(8385);
|
||||||
var schema$2 = __nccwpck_require__(8294);
|
var schema$2 = __nccwpck_require__(8294);
|
||||||
|
|
@ -93878,6 +93982,7 @@ const tagsByName = {
|
||||||
intOct: int.intOct,
|
intOct: int.intOct,
|
||||||
intTime: timestamp.intTime,
|
intTime: timestamp.intTime,
|
||||||
map: map.map,
|
map: map.map,
|
||||||
|
merge: merge.merge,
|
||||||
null: _null.nullTag,
|
null: _null.nullTag,
|
||||||
omap: omap.omap,
|
omap: omap.omap,
|
||||||
pairs: pairs.pairs,
|
pairs: pairs.pairs,
|
||||||
|
|
@ -93887,13 +93992,20 @@ const tagsByName = {
|
||||||
};
|
};
|
||||||
const coreKnownTags = {
|
const coreKnownTags = {
|
||||||
'tag:yaml.org,2002:binary': binary.binary,
|
'tag:yaml.org,2002:binary': binary.binary,
|
||||||
|
'tag:yaml.org,2002:merge': merge.merge,
|
||||||
'tag:yaml.org,2002:omap': omap.omap,
|
'tag:yaml.org,2002:omap': omap.omap,
|
||||||
'tag:yaml.org,2002:pairs': pairs.pairs,
|
'tag:yaml.org,2002:pairs': pairs.pairs,
|
||||||
'tag:yaml.org,2002:set': set.set,
|
'tag:yaml.org,2002:set': set.set,
|
||||||
'tag:yaml.org,2002:timestamp': timestamp.timestamp
|
'tag:yaml.org,2002:timestamp': timestamp.timestamp
|
||||||
};
|
};
|
||||||
function getTags(customTags, schemaName) {
|
function getTags(customTags, schemaName, addMergeTag) {
|
||||||
let tags = schemas.get(schemaName);
|
const schemaTags = schemas.get(schemaName);
|
||||||
|
if (schemaTags && !customTags) {
|
||||||
|
return addMergeTag && !schemaTags.includes(merge.merge)
|
||||||
|
? schemaTags.concat(merge.merge)
|
||||||
|
: schemaTags.slice();
|
||||||
|
}
|
||||||
|
let tags = schemaTags;
|
||||||
if (!tags) {
|
if (!tags) {
|
||||||
if (Array.isArray(customTags))
|
if (Array.isArray(customTags))
|
||||||
tags = [];
|
tags = [];
|
||||||
|
|
@ -93912,17 +94024,21 @@ function getTags(customTags, schemaName) {
|
||||||
else if (typeof customTags === 'function') {
|
else if (typeof customTags === 'function') {
|
||||||
tags = customTags(tags.slice());
|
tags = customTags(tags.slice());
|
||||||
}
|
}
|
||||||
return tags.map(tag => {
|
if (addMergeTag)
|
||||||
if (typeof tag !== 'string')
|
tags = tags.concat(merge.merge);
|
||||||
return tag;
|
return tags.reduce((tags, tag) => {
|
||||||
const tagObj = tagsByName[tag];
|
const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
|
||||||
if (tagObj)
|
if (!tagObj) {
|
||||||
return tagObj;
|
const tagName = JSON.stringify(tag);
|
||||||
const keys = Object.keys(tagsByName)
|
const keys = Object.keys(tagsByName)
|
||||||
.map(key => JSON.stringify(key))
|
.map(key => JSON.stringify(key))
|
||||||
.join(', ');
|
.join(', ');
|
||||||
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
||||||
});
|
}
|
||||||
|
if (!tags.includes(tagObj))
|
||||||
|
tags.push(tagObj);
|
||||||
|
return tags;
|
||||||
|
}, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.coreKnownTags = coreKnownTags;
|
exports.coreKnownTags = coreKnownTags;
|
||||||
|
|
@ -94184,6 +94300,82 @@ exports.intHex = intHex;
|
||||||
exports.intOct = intOct;
|
exports.intOct = intOct;
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 452:
|
||||||
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
var identity = __nccwpck_require__(1127);
|
||||||
|
var Scalar = __nccwpck_require__(3301);
|
||||||
|
|
||||||
|
// If the value associated with a merge key is a single mapping node, each of
|
||||||
|
// its key/value pairs is inserted into the current mapping, unless the key
|
||||||
|
// already exists in it. If the value associated with the merge key is a
|
||||||
|
// sequence, then this sequence is expected to contain mapping nodes and each
|
||||||
|
// of these nodes is merged in turn according to its order in the sequence.
|
||||||
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
||||||
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
||||||
|
const MERGE_KEY = '<<';
|
||||||
|
const merge = {
|
||||||
|
identify: value => value === MERGE_KEY ||
|
||||||
|
(typeof value === 'symbol' && value.description === MERGE_KEY),
|
||||||
|
default: 'key',
|
||||||
|
tag: 'tag:yaml.org,2002:merge',
|
||||||
|
test: /^<<$/,
|
||||||
|
resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {
|
||||||
|
addToJSMap: addMergeToJSMap
|
||||||
|
}),
|
||||||
|
stringify: () => MERGE_KEY
|
||||||
|
};
|
||||||
|
const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
||||||
|
(identity.isScalar(key) &&
|
||||||
|
(!key.type || key.type === Scalar.Scalar.PLAIN) &&
|
||||||
|
merge.identify(key.value))) &&
|
||||||
|
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
|
||||||
|
function addMergeToJSMap(ctx, map, value) {
|
||||||
|
value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
||||||
|
if (identity.isSeq(value))
|
||||||
|
for (const it of value.items)
|
||||||
|
mergeValue(ctx, map, it);
|
||||||
|
else if (Array.isArray(value))
|
||||||
|
for (const it of value)
|
||||||
|
mergeValue(ctx, map, it);
|
||||||
|
else
|
||||||
|
mergeValue(ctx, map, value);
|
||||||
|
}
|
||||||
|
function mergeValue(ctx, map, value) {
|
||||||
|
const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
||||||
|
if (!identity.isMap(source))
|
||||||
|
throw new Error('Merge sources must be maps or map aliases');
|
||||||
|
const srcMap = source.toJSON(null, ctx, Map);
|
||||||
|
for (const [key, value] of srcMap) {
|
||||||
|
if (map instanceof Map) {
|
||||||
|
if (!map.has(key))
|
||||||
|
map.set(key, value);
|
||||||
|
}
|
||||||
|
else if (map instanceof Set) {
|
||||||
|
map.add(key);
|
||||||
|
}
|
||||||
|
else if (!Object.prototype.hasOwnProperty.call(map, key)) {
|
||||||
|
Object.defineProperty(map, key, {
|
||||||
|
value,
|
||||||
|
writable: true,
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.addMergeToJSMap = addMergeToJSMap;
|
||||||
|
exports.isMergeKey = isMergeKey;
|
||||||
|
exports.merge = merge;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 303:
|
/***/ 303:
|
||||||
|
|
@ -94375,6 +94567,7 @@ var binary = __nccwpck_require__(6083);
|
||||||
var bool = __nccwpck_require__(8398);
|
var bool = __nccwpck_require__(8398);
|
||||||
var float = __nccwpck_require__(5782);
|
var float = __nccwpck_require__(5782);
|
||||||
var int = __nccwpck_require__(873);
|
var int = __nccwpck_require__(873);
|
||||||
|
var merge = __nccwpck_require__(452);
|
||||||
var omap = __nccwpck_require__(303);
|
var omap = __nccwpck_require__(303);
|
||||||
var pairs = __nccwpck_require__(8385);
|
var pairs = __nccwpck_require__(8385);
|
||||||
var set = __nccwpck_require__(1528);
|
var set = __nccwpck_require__(1528);
|
||||||
|
|
@ -94395,6 +94588,7 @@ const schema = [
|
||||||
float.floatExp,
|
float.floatExp,
|
||||||
float.float,
|
float.float,
|
||||||
binary.binary,
|
binary.binary,
|
||||||
|
merge.merge,
|
||||||
omap.omap,
|
omap.omap,
|
||||||
pairs.pairs,
|
pairs.pairs,
|
||||||
set.set,
|
set.set,
|
||||||
|
|
@ -94846,7 +95040,12 @@ function getTagObject(tags, item) {
|
||||||
let obj;
|
let obj;
|
||||||
if (identity.isScalar(item)) {
|
if (identity.isScalar(item)) {
|
||||||
obj = item.value;
|
obj = item.value;
|
||||||
const match = tags.filter(t => t.identify?.(obj));
|
let match = tags.filter(t => t.identify?.(obj));
|
||||||
|
if (match.length > 1) {
|
||||||
|
const testMatch = match.filter(t => t.test);
|
||||||
|
if (testMatch.length > 0)
|
||||||
|
match = testMatch;
|
||||||
|
}
|
||||||
tagObj =
|
tagObj =
|
||||||
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
4
index.js
4
index.js
|
|
@ -65,8 +65,10 @@ async function downloadBazelisk() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let filename = `bazelisk-${platform}-${arch}`
|
let filename = `bazelisk-${platform}-${arch}`
|
||||||
|
let toolname = 'bazel' // alias bazelisk as bazel
|
||||||
if (platform == 'windows') {
|
if (platform == 'windows') {
|
||||||
filename = `${filename}.exe`
|
filename = `${filename}.exe`
|
||||||
|
toolName = `${toolname}.exe`
|
||||||
}
|
}
|
||||||
|
|
||||||
const token = core.getInput('token')
|
const token = core.getInput('token')
|
||||||
|
|
@ -96,7 +98,7 @@ async function downloadBazelisk() {
|
||||||
|
|
||||||
core.debug('Adding to the cache...');
|
core.debug('Adding to the cache...');
|
||||||
fs.chmodSync(downloadPath, '755');
|
fs.chmodSync(downloadPath, '755');
|
||||||
const cachePath = await tc.cacheFile(downloadPath, 'bazel', 'bazelisk', version)
|
const cachePath = await tc.cacheFile(downloadPath, toolname, 'bazelisk', version)
|
||||||
core.debug(`Successfully cached bazelisk to ${cachePath}`)
|
core.debug(`Successfully cached bazelisk to ${cachePath}`)
|
||||||
|
|
||||||
return cachePath
|
return cachePath
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue