This commit is contained in:
softprops 2021-08-09 23:39:13 -04:00
parent c95b4533d0
commit 83e65faee7
2 changed files with 8 additions and 7 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -42,8 +42,8 @@ export const parseInputFiles = (files: string): string[] => {
(acc, line) => (acc, line) =>
acc acc
.concat(line.split(",")) .concat(line.split(","))
.filter(pat => pat) .filter((pat) => pat)
.map(pat => pat.trim()), .map((pat) => pat.trim()),
[] []
); );
}; };
@ -63,15 +63,16 @@ export const parseConfig = (env: Env): Config => {
? env.INPUT_PRERELEASE == "true" ? env.INPUT_PRERELEASE == "true"
: undefined, : undefined,
input_fail_on_unmatched_files: env.INPUT_FAIL_ON_UNMATCHED_FILES == "true", input_fail_on_unmatched_files: env.INPUT_FAIL_ON_UNMATCHED_FILES == "true",
input_target_commitish: env.INPUT_TARGET_COMMITISH, input_target_commitish: env.INPUT_TARGET_COMMITISH || undefined,
input_discussion_category_name: env.INPUT_DISCUSSION_CATEGORY_NAME input_discussion_category_name:
env.INPUT_DISCUSSION_CATEGORY_NAME || undefined,
}; };
}; };
export const paths = (patterns: string[]): string[] => { export const paths = (patterns: string[]): string[] => {
return patterns.reduce((acc: string[], pattern: string): string[] => { return patterns.reduce((acc: string[], pattern: string): string[] => {
return acc.concat( return acc.concat(
glob.sync(pattern).filter(path => lstatSync(path).isFile()) glob.sync(pattern).filter((path) => lstatSync(path).isFile())
); );
}, []); }, []);
}; };
@ -79,7 +80,7 @@ export const paths = (patterns: string[]): string[] => {
export const unmatchedPatterns = (patterns: string[]): string[] => { export const unmatchedPatterns = (patterns: string[]): string[] => {
return patterns.reduce((acc: string[], pattern: string): string[] => { return patterns.reduce((acc: string[], pattern: string): string[] => {
return acc.concat( return acc.concat(
glob.sync(pattern).filter(path => lstatSync(path).isFile()).length == 0 glob.sync(pattern).filter((path) => lstatSync(path).isFile()).length == 0
? [pattern] ? [pattern]
: [] : []
); );