fix: matching all nested files with a directory name (#1197)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2023-05-29 10:12:36 -06:00
committed by GitHub
parent 58c7ce2add
commit cf4fe8759a
5 changed files with 65 additions and 23 deletions

View File

@@ -757,7 +757,23 @@ export const getFilePatterns = async ({
core.debug(`file patterns: ${filePatterns}`)
return filePatterns.trim().split('\n').filter(Boolean)
return filePatterns
.trim()
.split('\n')
.filter(Boolean)
.map(pattern => {
if (pattern.endsWith('/')) {
return `${pattern}**`
} else {
const pathParts = pattern.split('/')
const lastPart = pathParts[pathParts.length - 1]
if (!lastPart.includes('.')) {
return `${pattern}/**`
} else {
return pattern
}
}
})
}
export const setOutput = async ({