Skip to content

Commit e8c7c85

Browse files
committed
feat: add glob pattern for multiple reports
1 parent daedb4d commit e8c7c85

File tree

5 files changed

+479
-40
lines changed

5 files changed

+479
-40
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ Add to your Github Actions workfile file:
6161
npx github-actions-ctrf path-to-your-ctrf-report.json
6262
```
6363

64+
Or use a glob pattern:
65+
66+
```bash
67+
npx github-actions-ctrf "ctrf/*.json"
68+
```
69+
6470
Before using the commands, ensure that your GitHub Actions runner has Node.js
6571
installed.
6672

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

343-
The [ctrf-cli](https://github.com/ctrf-io/ctrf-cli) package provides a method to
349+
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
344350
merge multiple ctrf json files into a single file.
345351

346352
After executing your tests, use the following command:
@@ -352,6 +358,20 @@ npx ctrf merge <directory>
352358
Replace directory with the path to the directory containing the CTRF reports you
353359
want to merge.
354360

361+
### Glob Pattern
362+
363+
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.
364+
365+
Here are some examples of glob patterns you can use:
366+
367+
`ctrf/ctrf-report.json` - Matches the exact file ctrf/ctrf-report.json.
368+
369+
`ctrf/*.json` - Matches all .json files in the ctrf directory.
370+
371+
`ctrf/**/*.json`- Matches all .json files in the ctrf directory and its subdirectories.
372+
373+
`ctrf/ctrf-report*` - Matches any file starting with ctrf-report (e.g., ctrf-report.json, ctrf-report-old.json).
374+
355375
## Pull Requests
356376

357377
There are two ways you can post comments on pull requests.

0 commit comments

Comments
 (0)