File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -43,15 +43,21 @@ else {
4343
4444// Read the files
4545core . info ( "Reading files..." ) ;
46- const files = await Promise . all ( inputs . files . split ( "\n" ) . map ( async f => {
46+ const files = ( await Promise . all ( inputs . files . split ( "\n" ) . map ( async f => {
4747 const { path : filePath , params} = parseInputFileParams ( f ) ;
48+ if ( "if" in params ) {
49+ if ( params . if === "false" )
50+ return null ;
51+ else if ( params . if !== "false" )
52+ core . warning ( `Invalid condition value ‘${ params . if } ’. Must be ‘true’ or ‘false’.` ) ;
53+ }
4854 const mimeType = params [ "type" ] ?? "application/octet-stream" ;
4955 const fileName = params [ "filename" ] ?? path . basename ( filePath ) ;
5056
5157 const data = await fs . readFile ( filePath ) ;
5258 core . info ( `Read file: ${ filePath } (type=${ mimeType } ; name=${ fileName } ; size=${ data . length } )` ) ;
5359 return new File ( [ data ] , path . basename ( filePath ) , { type : mimeType } ) ;
54- } ) ) ;
60+ } ) ) ) . filter ( f => f !== null ) ;
5561
5662// Upload the files
5763const octokit = github . getOctokit ( GITHUB_TOKEN ) ;
You can’t perform that action at this time.
0 commit comments