mirror of
https://github.com/actions/download-artifact.git
synced 2025-07-21 14:08:23 +02:00
Add warn-on-failure
Some users might not want their workflow jobs to die just because an artifact isn't available...
This commit is contained in:
parent
c3c8e4145a
commit
bd6ef4177a
6 changed files with 77 additions and 9 deletions
21
dist/index.js
vendored
21
dist/index.js
vendored
|
@ -121005,6 +121005,7 @@ var Inputs;
|
|||
Inputs["RunID"] = "run-id";
|
||||
Inputs["Pattern"] = "pattern";
|
||||
Inputs["MergeMultiple"] = "merge-multiple";
|
||||
Inputs["WarnOnFailure"] = "warn-on-failure";
|
||||
})(Inputs || (exports.Inputs = Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
|
@ -121069,7 +121070,7 @@ const chunk = (arr, n) => arr.reduce((acc, cur, i) => {
|
|||
return acc;
|
||||
}, []);
|
||||
exports.chunk = chunk;
|
||||
function run() {
|
||||
function run(flags) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const inputs = {
|
||||
name: core.getInput(constants_1.Inputs.Name, { required: false }),
|
||||
|
@ -121078,8 +121079,12 @@ function run() {
|
|||
repository: core.getInput(constants_1.Inputs.Repository, { required: false }),
|
||||
runID: parseInt(core.getInput(constants_1.Inputs.RunID, { required: false })),
|
||||
pattern: core.getInput(constants_1.Inputs.Pattern, { required: false }),
|
||||
mergeMultiple: core.getBooleanInput(constants_1.Inputs.MergeMultiple, { required: false })
|
||||
mergeMultiple: core.getBooleanInput(constants_1.Inputs.MergeMultiple, {
|
||||
required: false
|
||||
}),
|
||||
warnOnFailure: core.getBooleanInput(constants_1.Inputs.WarnOnFailure, { required: false })
|
||||
};
|
||||
flags.warnOnFailure = inputs.warnOnFailure;
|
||||
if (!inputs.path) {
|
||||
inputs.path = process.env['GITHUB_WORKSPACE'] || process.cwd();
|
||||
}
|
||||
|
@ -121147,7 +121152,17 @@ function run() {
|
|||
core.info('Download artifact has finished successfully');
|
||||
});
|
||||
}
|
||||
run().catch(err => core.setFailed(`Unable to download artifact(s): ${err.message}`));
|
||||
{
|
||||
const flags = { warnOnFailure: false };
|
||||
run(flags).catch(err => {
|
||||
if (flags.warnOnFailure) {
|
||||
core.setOutput('failure', `Unable to download artifact(s): ${err.message}`);
|
||||
}
|
||||
else {
|
||||
core.setFailed(`Unable to download artifact(s): ${err.message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue