Skip to content

Commit d5429ee

Browse files
committed
Allow specifying the artifact name
1 parent 70c9d1d commit d5429ee

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ inputs:
2727
description: "Whether to push the new commit back to the repository. Must be true or false. Default: true"
2828
required: false
2929
default: true
30-
upload:
31-
description: "Whether to upload the new diagram as an artiface. Must be true or false. Default: false"
30+
artifact_name:
31+
description: "If given, the name of an artifact to be created containing the diagram. Default: don't create an artifact."
3232
required: false
33-
default: false
33+
default: ''
3434
runs:
3535
using: "node12"
3636
main: "index.js"

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26312,11 +26312,11 @@ var main = async () => {
2631226312
}
2631326313
core.endGroup();
2631426314
}
26315-
const shouldUpload = core.getBooleanInput("upload");
26315+
const shouldUpload = core.getInput("artifact_name") !== "";
2631626316
if (shouldUpload) {
2631726317
core.startGroup("Upload diagram to artifacts");
2631826318
const client = artifact.create();
26319-
const result = await client.uploadArtifact("Diagram", [outputFile], ".");
26319+
const result = await client.uploadArtifact(core.getInput("artifact_name"), [outputFile], ".");
2632026320
if (result.failedItems.length > 0) {
2632126321
throw "Artifact was not uploaded successfully.";
2632226322
} else {

src/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ const main = async () => {
8585
core.endGroup()
8686
}
8787

88-
const shouldUpload = core.getBooleanInput('upload')
88+
const shouldUpload = core.getInput('artifact_name') !== ''
8989
if (shouldUpload) {
9090
core.startGroup('Upload diagram to artifacts')
9191
const client = artifact.create()
92-
const result = await client.uploadArtifact('Diagram', [outputFile], '.')
92+
const result = await client.uploadArtifact(core.getInput('artifact_name'), [outputFile], '.')
9393
if (result.failedItems.length > 0) {
9494
throw 'Artifact was not uploaded successfully.'
9595
} else {

0 commit comments

Comments
 (0)