Skip to content

Conversation

@kevbite
Copy link
Contributor

@kevbite kevbite commented Sep 15, 2025

This pull request introduces a new input option to control workflow behavior when no test files are found, improving flexibility and error handling for test reporting. The main changes add support for an exitOnNoFiles flag throughout the codebase, allowing users to configure whether the workflow should fail or succeed in such cases.

Input and CLI enhancements

  • Added a new input exit-on-no-files to action.yml and documented it in README.md, allowing users to specify if the workflow should fail when no test files are found. [1] [2]
  • Updated CLI argument parsing in src/core/cli.ts and related interfaces to support the new exitOnNoFiles option. [1] [2]

Propagation and usage of the new option

  • Propagated exitOnNoFiles through input handling in src/core/inputs.ts and the Inputs interface in src/types/reporter.ts, ensuring the flag is available throughout the workflow. [1] [2] [3]
  • Updated test setup in __tests__/ctrf/report-preparation.test.ts to include the new input for testing purposes.

Error handling and report reading

  • Modified readCtrfReports in src/utils/file-system.ts to accept and use the exitOnNoFiles flag, setting the workflow status to failure or success depending on the flag when no reports are found, and updated its usage in src/ctrf/report-preparation.ts. [1] [2] [3]

#221

@Ma11hewThomas
Copy link
Contributor

Thanks @kevbite, please resolve conflicts

@kevbite
Copy link
Contributor Author

kevbite commented Sep 28, 2025

@Ma11hewThomas all resolved 👍

@Ma11hewThomas Ma11hewThomas merged commit 861db83 into ctrf-io:main Oct 3, 2025
17 checks passed
@Ma11hewThomas
Copy link
Contributor

Thank you @kevbite, to be included in next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants