@@ -50,9 +50,28 @@ It supports multiple common report standards out of the box.
5050
5151- ** ESLint JSON** - JavaScript/TypeScript linting
5252- ** CheckStyle XML** - Java and other language linting
53+ - ** SARIF** - Static analysis results in the SARIF 2.1.0 format
5354- ** Prettier Check Logs** - Text output captured from ` prettier --check `
5455- ** Astro Check Logs** - Diagnostics emitted by ` astro check `
5556
57+ ### Expected Auto-Detection Paths
58+
59+ When ` report-paths ` uses ` auto:test ` , ` auto:coverage ` , ` auto:lint ` , or ` auto:all ` , the action searches for these glob patterns:
60+
61+ | ** Report Type** | ** Auto-Detected Paths** |
62+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
63+ | ** JUnit XML** | ` **/junit*.xml ` , ` **/test-results/**/*.xml ` , ` **/test-reports/**/*.xml ` , ` **/*test*.xml ` |
64+ | ** TAP** | ` **/*.tap ` |
65+ | ** Cobertura XML** | ` **/coverage/*-coverage.xml ` , ` **/coverage/*-cobertura.xml ` , ` **/coverage/coverage.xml ` , ` **/coverage/cobertura.xml ` |
66+ | ** LCOV** | ` **/coverage/lcov.info ` , ` **/lcov.info ` , ` **/coverage/*-lcov.info ` , ` **/*-lcov.info ` |
67+ | ** ESLint JSON** | ` **/eslint-report.json ` , ` **/eslint.json ` , ` **/*-eslint-report.json ` , ` **/*-eslint.json ` |
68+ | ** CheckStyle XML** | ` **/checkstyle-result.xml ` , ` **/checkstyle.xml ` , ` **/*-checkstyle-result.xml ` , ` **/*-checkstyle.xml ` |
69+ | ** SARIF** | ` **/*.sarif ` , ` **/*.sarif.json ` , ` **/sarif-report.json ` , ` **/*-sarif-report.json ` |
70+ | ** Prettier Check Logs** | ` **/prettier-check.log ` , ` **/prettier-check.txt ` , ` **/prettier-report.log ` , ` **/prettier-report.txt ` , ` **/*-prettier-check.log ` , ` **/*-prettier-check.txt ` , ` **/*-prettier-report.log ` , ` **/*-prettier-report.txt ` |
71+ | ** Astro Check Logs** | ` **/astro-check.log ` , ` **/astro-check.txt ` , ` **/astro-check-report.log ` , ` **/astro-check-report.txt ` , ` **/*-astro-check.log ` , ` **/*-astro-check.txt ` , ` **/*-astro-check-report.log ` , ` **/*-astro-check-report.txt ` |
72+
73+ If your reports are written elsewhere, pass explicit paths or glob patterns instead of relying on ` auto:* ` detection.
74+
5675<!-- usage:start -->
5776
5877## Usage
@@ -62,7 +81,7 @@ It supports multiple common report standards out of the box.
6281 with :
6382 # Paths to report files (glob patterns supported, one per line or comma-separated).
6483 # Set to `auto:test`, `auto:coverage`, `auto:lint`, or `auto:all` for automatic detection.
65- # Examples: `**/junit.xml`, `coverage/lcov.info`, `eslint-report.json`, `auto:all`, `auto:test,coverage/lcov.info`, `auto:test,auto:coverage`
84+ # Examples: `**/junit.xml`, `coverage/lcov.info`, `eslint-report.json`, `reports/results.sarif`, ` auto:all`, `auto:test,coverage/lcov.info`, `auto:test,auto:coverage`
6685 #
6786 # Default: `auto:all`
6887 report-paths : auto:all
@@ -110,26 +129,26 @@ It supports multiple common report standards out of the box.
110129
111130## Inputs
112131
113- | **Input** | **Description** | **Required** | **Default** |
114- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------- |
115- | **` report-paths`** | Paths to report files (glob patterns supported, one per line or comma-separated). | **false** | `auto:all` |
116- | | Set to `auto:test`, `auto:coverage`, `auto:lint`, or `auto:all` for automatic detection. | | |
117- | | Examples : ` **/junit.xml` , `coverage/lcov.info`, `eslint-report.json`, `auto:all`, `auto:test,coverage/lcov.info`, `auto:test,auto:coverage` | | |
118- | **`report-name`** | Name to display in the summary (e.g., `Test Results`, `Coverage Report`). | **false** | `Report Summary` |
119- | **`include-passed`** | Whether to include passed tests in the summary. | **false** | `false` |
120- | **`output-format`** | Output format : comma-separated list of `summary`, `markdown`, `annotations`, or `all` for everything. | **false** | `all` |
121- | **`fail-on-error`** | Whether to fail the action if any test failures are detected. | **false** | `false` |
122- | **`path-mapping`** | Path mapping(s) to rewrite file paths in reports (format : " from_path:to_path" ). | **false** | - |
123- | | Useful when tests/lints run in a different directory or container. | | |
124- | | Multiple mappings can be provided separated by newlines or commas. | | |
125- | | Examples : | | |
126- | | - Single mapping : " /app/src:./src" | | |
127- | | - Multiple mappings : " /app/src:./src,/app/tests:./tests" | | |
128- | | - Multi-line : \| | | |
129- | | /app/src:./src | | |
130- | | /app/tests:./tests | | |
131- | **`working-directory`** | Working directory where the action should operate. | **false** | `.` |
132- | | Can be absolute or relative to the repository root. | | |
132+ | **Input** | **Description** | **Required** | **Default** |
133+ | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------- |
134+ | **` report-paths`** | Paths to report files (glob patterns supported, one per line or comma-separated). | **false** | `auto:all` |
135+ | | Set to `auto:test`, `auto:coverage`, `auto:lint`, or `auto:all` for automatic detection. | | |
136+ | | Examples : ` **/junit.xml` , `coverage/lcov.info`, `eslint-report.json`, `reports/results.sarif`, ` auto:all`, `auto:test,coverage/lcov.info`, `auto:test,auto:coverage` | | |
137+ | **`report-name`** | Name to display in the summary (e.g., `Test Results`, `Coverage Report`). | **false** | `Report Summary` |
138+ | **`include-passed`** | Whether to include passed tests in the summary. | **false** | `false` |
139+ | **`output-format`** | Output format : comma-separated list of `summary`, `markdown`, `annotations`, or `all` for everything. | **false** | `all` |
140+ | **`fail-on-error`** | Whether to fail the action if any test failures are detected. | **false** | `false` |
141+ | **`path-mapping`** | Path mapping(s) to rewrite file paths in reports (format : " from_path:to_path" ). | **false** | - |
142+ | | Useful when tests/lints run in a different directory or container. | | |
143+ | | Multiple mappings can be provided separated by newlines or commas. | | |
144+ | | Examples : | | |
145+ | | - Single mapping : " /app/src:./src" | | |
146+ | | - Multiple mappings : " /app/src:./src,/app/tests:./tests" | | |
147+ | | - Multi-line : \| | | |
148+ | | /app/src:./src | | |
149+ | | /app/tests:./tests | | |
150+ | **`working-directory`** | Working directory where the action should operate. | **false** | `.` |
151+ | | Can be absolute or relative to the repository root. | | |
133152
134153<!-- inputs:end -->
135154<!-- secrets:start -->
@@ -178,7 +197,7 @@ Auto-detection modes:
178197
179198- ` auto:coverage` - Finds LCOV and Cobertura coverage files
180199
181- - ` auto:lint` - Finds ESLint JSON and CheckStyle XML files
200+ - ` auto:lint` - Finds ESLint JSON, CheckStyle XML, SARIF files, Prettier check logs, and Astro check logs
182201
183202- ` auto:all` - Finds all supported report types
184203
@@ -253,6 +272,22 @@ linting tools:
253272 output-format: "summary,annotations"
254273` ` `
255274
275+ # ## SARIF Static Analysis
276+
277+ Parse SARIF output from tools such as CodeQL or other static analyzers :
278+
279+ ` ` ` yaml
280+ - name: Run static analysis
281+ run: codeql database analyze db javascript-security-extended --format=sarif-latest --output=reports/results.sarif
282+
283+ - name: Parse SARIF report
284+ uses: hoverkraft-tech/ci-github-common/actions/parse-ci-reports@66578f5b9aec4ac5558b5dad750c4c74dfcb65c5 # 0.35.5
285+ with:
286+ report-paths: "reports/results.sarif"
287+ report-name: "Static Analysis"
288+ output-format: "summary,annotations"
289+ ` ` `
290+
256291# ## Fail on Test Failures
257292
258293` ` ` yaml
464499│ ├── LCOVParser.js
465500│ ├── ESLintParser.js
466501│ ├── CheckStyleParser.js
502+ │ ├── SarifParser.js
467503│ └── ParserFactory.js # Factory pattern for parser selection
468504├── formatters/ # Output formatters
469505│ ├── SummaryFormatter.js
0 commit comments