mirror of
https://github.com/actions/upload-artifact.git
synced 2025-06-24 08:36:12 +02:00
Upload multiple artifacts
This commit is contained in:
parent
58740802ef
commit
64a16cb7f4
5 changed files with 24 additions and 31 deletions
16
dist/index.js
vendored
16
dist/index.js
vendored
|
@ -4019,12 +4019,14 @@ function run() {
|
|||
const options = {
|
||||
continueOnError: false
|
||||
};
|
||||
const uploadResponse = yield artifactClient.uploadArtifact(inputs.artifactName, searchResult.filesToUpload, searchResult.rootDirectory, options);
|
||||
if (uploadResponse.failedItems.length > 0) {
|
||||
core.setFailed(`An error was encountered when uploading ${uploadResponse.artifactName}. There were ${uploadResponse.failedItems.length} items that failed to upload.`);
|
||||
}
|
||||
else {
|
||||
core.info(`Artifact ${uploadResponse.artifactName} has been successfully uploaded!`);
|
||||
for (const file of searchResult.filesToUpload) {
|
||||
const uploadResponse = yield artifactClient.uploadArtifact(file, [file], searchResult.rootDirectory, options);
|
||||
if (uploadResponse.failedItems.length > 0) {
|
||||
core.setFailed(`An error was encountered when uploading ${uploadResponse.artifactName}. There were ${uploadResponse.failedItems.length} items that failed to upload.`);
|
||||
}
|
||||
else {
|
||||
core.info(`Artifact ${uploadResponse.artifactName} has been successfully uploaded!`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6383,7 +6385,6 @@ const constants_1 = __webpack_require__(694);
|
|||
* Helper to get all the inputs for the action
|
||||
*/
|
||||
function getInputs() {
|
||||
const name = core.getInput(constants_1.Inputs.Name);
|
||||
const path = core.getInput(constants_1.Inputs.Path, { required: true });
|
||||
const ifNoFilesFound = core.getInput(constants_1.Inputs.IfNoFilesFound);
|
||||
const noFileBehavior = constants_1.NoFileOptions[ifNoFilesFound];
|
||||
|
@ -6391,7 +6392,6 @@ function getInputs() {
|
|||
core.setFailed(`Unrecognized ${constants_1.Inputs.IfNoFilesFound} input. Provided: ${ifNoFilesFound}. Available options: ${Object.keys(constants_1.NoFileOptions)}`);
|
||||
}
|
||||
return {
|
||||
artifactName: name,
|
||||
searchPath: path,
|
||||
ifNoFilesFound: noFileBehavior
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue