File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,13 @@ inputs:
24
24
description : " The branch name to push the diagram to (branch will be created if it does not yet exist). For example: diagram"
25
25
required : false
26
26
push :
27
- description : " Whether to push the new commit back to the repository. Default: true"
27
+ description : " Whether to push the new commit back to the repository. Must be true or false. Default: true"
28
28
required : false
29
+ default : true
29
30
upload :
30
- description : " Whether to upload the new diagram as an artiface. Default: false"
31
+ description : " Whether to upload the new diagram as an artiface. Must be true or false. Default: false"
31
32
required : false
33
+ default : false
32
34
runs :
33
35
using : " node12"
34
36
main : " index.js"
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ const main = async () => {
68
68
return
69
69
}
70
70
71
- const shouldPush = getAsBoolean ( core . getInput ( 'push' ) , true )
71
+ const shouldPush = core . getBooleanInput ( 'push' )
72
72
if ( shouldPush ) {
73
73
core . startGroup ( 'Commit and push diagram' )
74
74
await exec ( 'git' , [ 'commit' , '-m' , commitMessage ] )
@@ -85,7 +85,7 @@ const main = async () => {
85
85
core . endGroup ( )
86
86
}
87
87
88
- const shouldUpload = getAsBoolean ( core . getInput ( 'upload' ) , false )
88
+ const shouldUpload = core . getBooleanInput ( 'upload' )
89
89
if ( shouldUpload ) {
90
90
core . startGroup ( 'Upload diagram to artifacts' )
91
91
const client = artifact . create ( )
@@ -125,7 +125,3 @@ function execWithOutput(command, args) {
125
125
}
126
126
} )
127
127
}
128
-
129
- function getAsBoolean ( option , defaultValue ) {
130
- return option === '' ? defaultValue : ( option . toLowerCase ( ) === 'true' )
131
- }
You can’t perform that action at this time.
0 commit comments