From 2a56197002c116bc64d6253131ad06f4790d660a Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 21 Dec 2023 14:21:02 -0500 Subject: [PATCH] Testing fix --- download-artifacts/main.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/download-artifacts/main.js b/download-artifacts/main.js index e51170d10..fbac62f63 100644 --- a/download-artifacts/main.js +++ b/download-artifacts/main.js @@ -24,7 +24,7 @@ async function main() { const token = core.getInput("github_token", { required: true }) const [owner, repo] = core.getInput("repo", { required: true }).split("/") const path = core.getInput("path", { required: true }) - const name = core.getInput("artifacts") + const names = core.getInput("artifacts") const nameIsRegExp = core.getBooleanInput("name_is_regexp") const skipUnpack = core.getBooleanInput("skip_unpack") const ifNoArtifactFound = core.getInput("if_no_artifact_found") @@ -44,7 +44,7 @@ async function main() { const client = github.getOctokit(token) core.info(`==> Repository: ${owner}/${repo}`) - core.info(`==> Artifact name: ${name}`) + core.info(`==> Artifact name(s): ${names}`) core.info(`==> Local path: ${path}`) if (!workflow) { @@ -177,16 +177,19 @@ async function main() { run_id: runID, }) + const artifactNames = names.split(",").map(artifactName => artifactName.trim()) + core.info(`TESTING: ${artifactNames}`) + // One artifact if 'name' input is specified, one or more if `name` is a regular expression, all otherwise. - if (name) { + if (names) { filtered = artifacts.filter((artifact) => { if (nameIsRegExp) { - return artifact.name.match(name) !== null + return artifact.name.match(names) !== null } - return artifact.name == name + return artifact.name == names }) if (filtered.length == 0) { - core.info(`==> (not found) Artifact: ${name}`) + core.info(`==> (not found) Artifact: ${names}`) core.info('==> Found the following artifacts instead:') for (const artifact of artifacts) { core.info(`\t==> (found) Artifact: ${artifact.name}`)