1
0
Fork 0
mirror of https://code.forgejo.org/actions/download-artifact.git synced 2024-12-23 12:36:01 +01:00

chore: transpile action code

This commit is contained in:
thundermiracle 2023-02-18 11:25:52 +09:00
parent 808bacee91
commit b8b81c1932

17
dist/index.js vendored
View file

@ -9498,6 +9498,7 @@ var Inputs;
(function (Inputs) { (function (Inputs) {
Inputs["Name"] = "name"; Inputs["Name"] = "name";
Inputs["Path"] = "path"; Inputs["Path"] = "path";
Inputs["IfNoArtifact"] = "if-no-artifact";
})(Inputs = exports.Inputs || (exports.Inputs = {})); })(Inputs = exports.Inputs || (exports.Inputs = {}));
var Outputs; var Outputs;
(function (Outputs) { (function (Outputs) {
@ -9536,9 +9537,12 @@ const path_1 = __nccwpck_require__(1017);
const constants_1 = __nccwpck_require__(9042); const constants_1 = __nccwpck_require__(9042);
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let ifNoArtifact = '';
try { try {
const name = core.getInput(constants_1.Inputs.Name, { required: false }); const name = core.getInput(constants_1.Inputs.Name, { required: false });
const path = core.getInput(constants_1.Inputs.Path, { required: false }); const path = core.getInput(constants_1.Inputs.Path, { required: false });
ifNoArtifact =
core.getInput(constants_1.Inputs.IfNoArtifact, { required: false }) || 'fail';
let resolvedPath; let resolvedPath;
// resolve tilde expansions, path.replace only replaces the first occurrence of a pattern // resolve tilde expansions, path.replace only replaces the first occurrence of a pattern
if (path.startsWith(`~`)) { if (path.startsWith(`~`)) {
@ -9574,7 +9578,18 @@ function run() {
core.info('Artifact download has finished successfully'); core.info('Artifact download has finished successfully');
} }
catch (err) { catch (err) {
core.setFailed(err.message); const { message } = err;
switch (ifNoArtifact) {
case 'warn':
core.warning(message);
break;
case 'ignore':
core.info(message);
break;
case 'fail':
default:
core.setFailed(message);
}
} }
}); });
} }