File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,20 @@ const fileTypesMap: Record<string, string> = {
6262
6363const files = await Promise . all ( filePaths . map ( async filePath => {
6464 const type = fileTypesMap [ path . extname ( filePath ) ] ;
65+ // Check if the path is an url
66+ if ( / ^ h t t p s ? : \/ \/ / . test ( filePath ) ) {
67+ const url = new URL ( filePath ) ;
68+ const res = await fetch ( url ) ;
69+ const data = await res . blob ( ) ;
70+
71+ return new File ( [ data ] , path . basename ( url . pathname ) , { type : data . type } ) ;
72+ }
73+
6574 const data = await fs . readFile ( filePath ) ;
6675 return new File ( [ data ] , path . basename ( filePath ) , { type} ) ;
6776} ) ) ;
6877
69- // If primary file is specified, check that it is present
78+ // If a primary file is specified, check that it is present
7079if ( primaryFileName !== null && ! files . some ( f => f . name === primaryFileName ) ) {
7180 core . setFailed ( new Error ( `Primary file “${ primaryFileName } ” is not present in the list of files.` ) ) ;
7281 process . exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments