Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitafab037

Browse files
committed
Simplify boolean inputs
1 parentbed9482 commitafab037

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

‎action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ inputs:
2424
description:"The branch name to push the diagram to (branch will be created if it does not yet exist). For example: diagram"
2525
required:false
2626
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"
2828
required:false
29+
default:true
2930
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"
3132
required:false
33+
default:false
3234
runs:
3335
using:"node12"
3436
main:"index.js"

‎src/index.jsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const main = async () => {
6868
return
6969
}
7070

71-
constshouldPush=getAsBoolean(core.getInput('push'),true)
71+
constshouldPush=core.getBooleanInput('push')
7272
if(shouldPush){
7373
core.startGroup('Commit and push diagram')
7474
awaitexec('git',['commit','-m',commitMessage])
@@ -85,7 +85,7 @@ const main = async () => {
8585
core.endGroup()
8686
}
8787

88-
constshouldUpload=getAsBoolean(core.getInput('upload'),false)
88+
constshouldUpload=core.getBooleanInput('upload')
8989
if(shouldUpload){
9090
core.startGroup('Upload diagram to artifacts')
9191
constclient=artifact.create()
@@ -125,7 +125,3 @@ function execWithOutput(command, args) {
125125
}
126126
})
127127
}
128-
129-
functiongetAsBoolean(option,defaultValue){
130-
returnoption==='' ?defaultValue :(option.toLowerCase()==='true')
131-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp