@@ -35,10 +35,10 @@ export function showInputs(inps: Inputs): void {
35
35
export function getInputs ( ) : Inputs {
36
36
let useBuiltinJekyll = false ;
37
37
38
- const enableJekyll : boolean =
39
- ( core . getInput ( 'enable_jekyll' ) || 'false' ) . toUpperCase ( ) === 'TRUE' ;
40
- const disableNoJekyll : boolean =
41
- ( core . getInput ( 'disable_nojekyll' ) || 'false' ) . toUpperCase ( ) === 'TRUE' ;
38
+ const isBoolean = ( param : string ) : boolean => ( param || 'false' ) . toUpperCase ( ) === 'TRUE' ;
39
+
40
+ const enableJekyll : boolean = isBoolean ( core . getInput ( 'enable_jekyll' ) ) ;
41
+ const disableNoJekyll : boolean = isBoolean ( core . getInput ( 'disable_nojekyll' ) ) ;
42
42
43
43
if ( enableJekyll && disableNoJekyll ) {
44
44
throw new Error ( `Use either of enable_jekyll or disable_nojekyll` ) ;
@@ -56,9 +56,9 @@ export function getInputs(): Inputs {
56
56
PublishDir : core . getInput ( 'publish_dir' ) ,
57
57
DestinationDir : core . getInput ( 'destination_dir' ) ,
58
58
ExternalRepository : core . getInput ( 'external_repository' ) ,
59
- AllowEmptyCommit : ( core . getInput ( 'allow_empty_commit' ) || 'false' ) . toUpperCase ( ) === 'TRUE' ,
60
- KeepFiles : ( core . getInput ( 'keep_files' ) || 'false' ) . toUpperCase ( ) === 'TRUE' ,
61
- ForceOrphan : ( core . getInput ( 'force_orphan' ) || 'false' ) . toUpperCase ( ) === 'TRUE' ,
59
+ AllowEmptyCommit : isBoolean ( core . getInput ( 'allow_empty_commit' ) ) ,
60
+ KeepFiles : isBoolean ( core . getInput ( 'keep_files' ) ) ,
61
+ ForceOrphan : isBoolean ( core . getInput ( 'force_orphan' ) ) ,
62
62
UserName : core . getInput ( 'user_name' ) ,
63
63
UserEmail : core . getInput ( 'user_email' ) ,
64
64
CommitMessage : core . getInput ( 'commit_message' ) ,
0 commit comments