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 glob pattern for multiple reports #67

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ Add to your Github Actions workfile file:
npx github-actions-ctrf path-to-your-ctrf-report.json
```

Or use a glob pattern:

```bash
npx github-actions-ctrf "ctrf/*.json"
```

Before using the commands, ensure that your GitHub Actions runner has Node.js
installed.

Expand Down Expand Up @@ -340,7 +346,8 @@ This ensures that the test results are available for future runs.
You can merge reports if your chosen reporter generates multiple reports through
design, parallelisation or otherwise.

The [ctrf-cli](https://github.com/ctrf-io/ctrf-cli) package provides a method to
If you use a glob pattern, reports will be merged automatically, otherwise the
[ctrf-cli](https://github.com/ctrf-io/ctrf-cli) package provides a method to
merge multiple ctrf json files into a single file.

After executing your tests, use the following command:
Expand All @@ -352,6 +359,24 @@ npx ctrf merge <directory>
Replace directory with the path to the directory containing the CTRF reports you
want to merge.

### Glob Pattern

A glob pattern is a string that specifies sets of filenames with wildcards and
special characters. This allows you to match multiple files or directories
without specifying each file explicitly.

Here are some examples of glob patterns you can use:

`ctrf/ctrf-report.json` - Matches the exact file ctrf/ctrf-report.json.

`ctrf/*.json` - Matches all .json files in the ctrf directory.

`ctrf/**/*.json`- Matches all .json files in the ctrf directory and its
subdirectories.

`ctrf/ctrf-report*` - Matches any file starting with ctrf-report (e.g.,
ctrf-report.json, ctrf-report-old.json).

## Pull Requests

There are two ways you can post comments on pull requests.
Expand Down
Loading
Loading