Skip to content

Commit 273c5fc

Browse files
Merge pull request #67 from ctrf-io/feat/glob-pattern
feat: add glob pattern for multiple reports
2 parents daedb4d + 1fb014c commit 273c5fc

File tree

5 files changed

+484
-40
lines changed

5 files changed

+484
-40
lines changed

README.md

Lines changed: 26 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,8 @@ 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
350+
[ctrf-cli](https://github.com/ctrf-io/ctrf-cli) package provides a method to
344351
merge multiple ctrf json files into a single file.
345352

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

362+
### Glob Pattern
363+
364+
A glob pattern is a string that specifies sets of filenames with wildcards and
365+
special characters. This allows you to match multiple files or directories
366+
without specifying each file explicitly.
367+
368+
Here are some examples of glob patterns you can use:
369+
370+
`ctrf/ctrf-report.json` - Matches the exact file ctrf/ctrf-report.json.
371+
372+
`ctrf/*.json` - Matches all .json files in the ctrf directory.
373+
374+
`ctrf/**/*.json`- Matches all .json files in the ctrf directory and its
375+
subdirectories.
376+
377+
`ctrf/ctrf-report*` - Matches any file starting with ctrf-report (e.g.,
378+
ctrf-report.json, ctrf-report-old.json).
379+
355380
## Pull Requests
356381

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

0 commit comments

Comments
 (0)