Skip to content

Commit 07ab29f

Browse files
add merge_multiple option (#327)
1 parent 20319c5 commit 07ab29f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ inputs:
9292
description: Use system provided `unzip` utility instead of JS library for unpacking
9393
required: false
9494
default: false
95+
merge_multiple:
96+
description: If multiple artifacts are found with `name_is_regexp` set to `true`, merge them into one directory
97+
required: false
98+
default: false
9599
outputs:
96100
error_message:
97101
description: The error message, if an error occurs

main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ async function main() {
3939
const skipUnpack = core.getBooleanInput("skip_unpack")
4040
const ifNoArtifactFound = core.getInput("if_no_artifact_found")
4141
const useUnzip = core.getBooleanInput("use_unzip")
42+
const mergeMultiple = core.getBooleanInput("merge_multiple")
4243
let workflow = core.getInput("workflow")
4344
let workflowSearch = core.getBooleanInput("workflow_search")
4445
let workflowConclusion = core.getInput("workflow_conclusion")
@@ -268,7 +269,7 @@ async function main() {
268269
continue
269270
}
270271

271-
const dir = name && !nameIsRegExp ? path : pathname.join(path, artifact.name)
272+
const dir = name && (!nameIsRegExp || mergeMultiple) ? path : pathname.join(path, artifact.name)
272273

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

0 commit comments

Comments
 (0)