Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add warning message for invalid patterns #625

Merged
merged 5 commits into from
Jan 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,23 +263,26 @@ export async function run(): Promise<void> {

const pathsOutput = paths.join(separator)

const hasCustomPatterns = (
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
files !== '' ||
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
filesFromSourceFile !== '' ||
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
excludedFiles !== '' ||
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
excludedFilesFromSourceFile !== ''
)
jackton1 marked this conversation as resolved.
Show resolved Hide resolved

if (pathsOutput) {
const pathsOutputFile = await tempfile('.txt')
await fs.writeFile(pathsOutputFile, pathsOutput, {flag: 'w'})

core.setOutput('paths-output-file', pathsOutputFile)
core.saveState('paths-output-file', pathsOutputFile)
core.info(`Successfully created paths-output-file: ${pathsOutputFile}`)
} else if (hasCustomPatterns) {
core.warning("No paths found using the specified patterns")
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
}

core.setOutput('paths', pathsOutput)
core.setOutput(
'has-custom-patterns',
files !== '' ||
filesFromSourceFile !== '' ||
excludedFiles !== '' ||
excludedFilesFromSourceFile !== ''
)
core.setOutput('has-custom-patterns', hasCustomPatterns)
}

if (!process.env.TESTING) {
Expand Down