javascript-action/dist/index.js.map

1 line
13 KiB
Plaintext

{"version":3,"sources":["/webpack/bootstrap","../external \"os\"","../index.js","../node_modules/@actions/core/lib/command.js","../node_modules/@actions/core/lib/core.js","../external \"path\"","../wait.js"],"names":[],"mappings":";;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC3CA,+B;;;;;;;ACAA,aAAa,mBAAO,CAAC,GAAe;AACpC,aAAa,mBAAO,CAAC,GAAQ;;;AAG7B;AACA;AACA,O;AACA;AACA,yBAAyB,GAAG;;AAE5B;AACA;AACA;;AAEA;AACA,G;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;ACrBa;AACb,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,WAAW,mBAAO,CAAC,EAAI;AACvB;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,yBAAyB;AACzB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,IAAI,GAAG,UAAU,UAAU,GAAG;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mBAAmB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,mC;;;;;;;;ACjEa;AACb;AACA,2BAA2B,+DAA+D,gBAAgB,EAAE,EAAE;AAC9G;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,qFAAqF;AACpH;AACA,KAAK;AACL;AACA,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,kBAAkB,mBAAO,CAAC,GAAW;AACrC,WAAW,mBAAO,CAAC,EAAI;AACvB,aAAa,mBAAO,CAAC,GAAM;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,aAAa,OAAO,cAAc,OAAO,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,6BAA6B,UAAU,EAAE,eAAe,EAAE,oBAAoB;AAC9E;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,sCAAsC;AAC3E;AACA,4DAA4D,KAAK;AACjE;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,OAAO;AACP,gC;;;;;;;AChLA,iC;;;;;;;ACAA;AACA;AACA,4C;AACA,mD;AACA;;AAEA;AACA,GAAG;AACH;;AAEA,cAAc","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tvar threw = true;\n \t\ttry {\n \t\t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n \t\t\tthrew = false;\n \t\t} finally {\n \t\t\tif(threw) delete installedModules[moduleId];\n \t\t}\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t__webpack_require__.ab = __dirname + \"/\";\n\n \t// the startup function\n \tfunction startup() {\n \t\t// Load entry module and return exports\n \t\treturn __webpack_require__(104);\n \t};\n\n \t// run startup\n \treturn startup();\n","module.exports = require(\"os\");","const core = require('@actions/core');\nconst wait = require('./wait');\n\n\n// most @actions toolkit packages have async methods\nasync function run() {\n try { \n const ms = core.getInput('milliseconds');\n core.info(`Waiting ${ms} milliseconds ...`)\n\n core.debug((new Date()).toTimeString()) // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true\n await wait(parseInt(ms));\n core.info((new Date()).toTimeString())\n\n core.setOutput('time', new Date().toTimeString());\n } \n catch (error) {\n core.setFailed(error.message);\n }\n}\n\nrun()\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst os = require(\"os\");\r\n/**\r\n * Commands\r\n *\r\n * Command Format:\r\n * ##[name key=value;key=value]message\r\n *\r\n * Examples:\r\n * ##[warning]This is the user warning message\r\n * ##[set-secret name=mypassword]definitelyNotAPassword!\r\n */\r\nfunction issueCommand(command, properties, message) {\r\n const cmd = new Command(command, properties, message);\r\n process.stdout.write(cmd.toString() + os.EOL);\r\n}\r\nexports.issueCommand = issueCommand;\r\nfunction issue(name, message = '') {\r\n issueCommand(name, {}, message);\r\n}\r\nexports.issue = issue;\r\nconst CMD_STRING = '::';\r\nclass Command {\r\n constructor(command, properties, message) {\r\n if (!command) {\r\n command = 'missing.command';\r\n }\r\n this.command = command;\r\n this.properties = properties;\r\n this.message = message;\r\n }\r\n toString() {\r\n let cmdStr = CMD_STRING + this.command;\r\n if (this.properties && Object.keys(this.properties).length > 0) {\r\n cmdStr += ' ';\r\n for (const key in this.properties) {\r\n if (this.properties.hasOwnProperty(key)) {\r\n const val = this.properties[key];\r\n if (val) {\r\n // safely append the val - avoid blowing up when attempting to\r\n // call .replace() if message is not a string for some reason\r\n cmdStr += `${key}=${escape(`${val || ''}`)},`;\r\n }\r\n }\r\n }\r\n }\r\n cmdStr += CMD_STRING;\r\n // safely append the message - avoid blowing up when attempting to\r\n // call .replace() if message is not a string for some reason\r\n const message = `${this.message || ''}`;\r\n cmdStr += escapeData(message);\r\n return cmdStr;\r\n }\r\n}\r\nfunction escapeData(s) {\r\n return s.replace(/\\r/g, '%0D').replace(/\\n/g, '%0A');\r\n}\r\nfunction escape(s) {\r\n return s\r\n .replace(/\\r/g, '%0D')\r\n .replace(/\\n/g, '%0A')\r\n .replace(/]/g, '%5D')\r\n .replace(/;/g, '%3B');\r\n}\r\n//# sourceMappingURL=command.js.map","\"use strict\";\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst command_1 = require(\"./command\");\r\nconst os = require(\"os\");\r\nconst path = require(\"path\");\r\n/**\r\n * The code to exit an action\r\n */\r\nvar ExitCode;\r\n(function (ExitCode) {\r\n /**\r\n * A code indicating that the action was successful\r\n */\r\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\r\n /**\r\n * A code indicating that the action was a failure\r\n */\r\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\r\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\r\n//-----------------------------------------------------------------------\r\n// Variables\r\n//-----------------------------------------------------------------------\r\n/**\r\n * sets env variable for this action and future actions in the job\r\n * @param name the name of the variable to set\r\n * @param val the value of the variable\r\n */\r\nfunction exportVariable(name, val) {\r\n process.env[name] = val;\r\n command_1.issueCommand('set-env', { name }, val);\r\n}\r\nexports.exportVariable = exportVariable;\r\n/**\r\n * exports the variable and registers a secret which will get masked from logs\r\n * @param name the name of the variable to set\r\n * @param val value of the secret\r\n */\r\nfunction exportSecret(name, val) {\r\n exportVariable(name, val);\r\n // the runner will error with not implemented\r\n // leaving the function but raising the error earlier\r\n command_1.issueCommand('set-secret', {}, val);\r\n throw new Error('Not implemented.');\r\n}\r\nexports.exportSecret = exportSecret;\r\n/**\r\n * Prepends inputPath to the PATH (for this action and future actions)\r\n * @param inputPath\r\n */\r\nfunction addPath(inputPath) {\r\n command_1.issueCommand('add-path', {}, inputPath);\r\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\r\n}\r\nexports.addPath = addPath;\r\n/**\r\n * Gets the value of an input. The value is also trimmed.\r\n *\r\n * @param name name of the input to get\r\n * @param options optional. See InputOptions.\r\n * @returns string\r\n */\r\nfunction getInput(name, options) {\r\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\r\n if (options && options.required && !val) {\r\n throw new Error(`Input required and not supplied: ${name}`);\r\n }\r\n return val.trim();\r\n}\r\nexports.getInput = getInput;\r\n/**\r\n * Sets the value of an output.\r\n *\r\n * @param name name of the output to set\r\n * @param value value to store\r\n */\r\nfunction setOutput(name, value) {\r\n command_1.issueCommand('set-output', { name }, value);\r\n}\r\nexports.setOutput = setOutput;\r\n//-----------------------------------------------------------------------\r\n// Results\r\n//-----------------------------------------------------------------------\r\n/**\r\n * Sets the action status to failed.\r\n * When the action exits it will be with an exit code of 1\r\n * @param message add error issue message\r\n */\r\nfunction setFailed(message) {\r\n process.exitCode = ExitCode.Failure;\r\n error(message);\r\n}\r\nexports.setFailed = setFailed;\r\n//-----------------------------------------------------------------------\r\n// Logging Commands\r\n//-----------------------------------------------------------------------\r\n/**\r\n * Writes debug message to user log\r\n * @param message debug message\r\n */\r\nfunction debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}\r\nexports.debug = debug;\r\n/**\r\n * Adds an error issue\r\n * @param message error issue message\r\n */\r\nfunction error(message) {\r\n command_1.issue('error', message);\r\n}\r\nexports.error = error;\r\n/**\r\n * Adds an warning issue\r\n * @param message warning issue message\r\n */\r\nfunction warning(message) {\r\n command_1.issue('warning', message);\r\n}\r\nexports.warning = warning;\r\n/**\r\n * Writes info to log with console.log.\r\n * @param message info message\r\n */\r\nfunction info(message) {\r\n process.stdout.write(message + os.EOL);\r\n}\r\nexports.info = info;\r\n/**\r\n * Begin an output group.\r\n *\r\n * Output until the next `groupEnd` will be foldable in this group\r\n *\r\n * @param name The name of the output group\r\n */\r\nfunction startGroup(name) {\r\n command_1.issue('group', name);\r\n}\r\nexports.startGroup = startGroup;\r\n/**\r\n * End an output group.\r\n */\r\nfunction endGroup() {\r\n command_1.issue('endgroup');\r\n}\r\nexports.endGroup = endGroup;\r\n/**\r\n * Wrap an asynchronous function call in a group.\r\n *\r\n * Returns the same type as the function itself.\r\n *\r\n * @param name The name of the group\r\n * @param fn The function to wrap in the group\r\n */\r\nfunction group(name, fn) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n startGroup(name);\r\n let result;\r\n try {\r\n result = yield fn();\r\n }\r\n finally {\r\n endGroup();\r\n }\r\n return result;\r\n });\r\n}\r\nexports.group = group;\r\n//# sourceMappingURL=core.js.map","module.exports = require(\"path\");","let wait = function(milliseconds) {\n return new Promise((resolve, reject) => {\n if (typeof(milliseconds) !== 'number') { \n throw new Error('milleseconds not a number'); \n }\n\n setTimeout(() => resolve(\"done!\"), milliseconds)\n });\n}\n\nmodule.exports = wait;\n"],"sourceRoot":""}