Upload multiple artifacts

This commit is contained in:
darkkeks 2020-09-02 01:27:15 +03:00
commit 64a16cb7f4
5 changed files with 24 additions and 31 deletions

View file

@ -40,21 +40,24 @@ async function run(): Promise<void> {
const options: UploadOptions = {
continueOnError: false
}
const uploadResponse = await 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 = await 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!`
)
}
}
}
} catch (err) {