Skip to content

Commit

Permalink
add merge_multiple option (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
timostroehlein authored Feb 20, 2025
1 parent 20319c5 commit 07ab29f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ inputs:
description: Use system provided `unzip` utility instead of JS library for unpacking
required: false
default: false
merge_multiple:
description: If multiple artifacts are found with `name_is_regexp` set to `true`, merge them into one directory
required: false
default: false
outputs:
error_message:
description: The error message, if an error occurs
Expand Down
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ async function main() {
const skipUnpack = core.getBooleanInput("skip_unpack")
const ifNoArtifactFound = core.getInput("if_no_artifact_found")
const useUnzip = core.getBooleanInput("use_unzip")
const mergeMultiple = core.getBooleanInput("merge_multiple")
let workflow = core.getInput("workflow")
let workflowSearch = core.getBooleanInput("workflow_search")
let workflowConclusion = core.getInput("workflow_conclusion")
Expand Down Expand Up @@ -268,7 +269,7 @@ async function main() {
continue
}

const dir = name && !nameIsRegExp ? path : pathname.join(path, artifact.name)
const dir = name && (!nameIsRegExp || mergeMultiple) ? path : pathname.join(path, artifact.name)

fs.mkdirSync(dir, { recursive: true })

Expand Down

0 comments on commit 07ab29f

Please sign in to comment.