File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,19 @@ describe('subjectFromInputs', () => {
203203 } )
204204 } )
205205
206+ describe ( 'when a file glob is supplied which also matches non-files' , ( ) => {
207+ beforeEach ( async ( ) => {
208+ process . env [ 'INPUT_SUBJECT-PATH' ] = `${ dir } *`
209+ } )
210+
211+ it ( 'returns the subjects (excluding non-files)' , async ( ) => {
212+ const subjects = await subjectFromInputs ( )
213+
214+ expect ( subjects ) . toBeDefined ( )
215+ expect ( subjects ) . toHaveLength ( 7 )
216+ } )
217+ } )
218+
206219 describe ( 'when a comma-separated list is supplied' , ( ) => {
207220 beforeEach ( async ( ) => {
208221 process . env [ 'INPUT_SUBJECT-PATH' ] =
Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ const getSubjectFromPath = async (
5656 const files = await glob . create ( subPath ) . then ( async g => g . glob ( ) )
5757
5858 for ( const file of files ) {
59+ // Skip anything that is NOT a file
60+ if ( ! fs . statSync ( file ) . isFile ( ) ) {
61+ continue
62+ }
63+
5964 const name = subjectName || path . parse ( file ) . base
6065 const digest = await digestFile ( DIGEST_ALGORITHM , file )
6166
You can’t perform that action at this time.
0 commit comments