Test Results
Surface test results directly in your PRs. Dev Herald reads your test runner’s JSON output and formats it into a clean, readable comment — pass counts, failure details, and suite breakdowns all in one place.

Basic usage
- name: Post Test Results
if: always()
uses: dev-herald/comment@v1
with:
api-key: ${{ secrets.DEV_HERALD_API_KEY }}
pr-number: ${{ github.event.pull_request.number }}
sticky-id: test-results
signal: 'TEST_RESULTS'
test-results: |
- name: Unit Tests
path: vitest-results/results.jsonif: always() ensures the comment posts even when tests fail — that’s when you need the visibility most.
Options
| Option | Required | Description |
|---|---|---|
signal | ✅ | Must be TEST_RESULTS |
test-results | ✅ | YAML list of test suites — each entry needs a name and path to the JSON output file |
sticky-id | Recommended | Reuses the same comment on every push instead of creating a new one |
Vitest
Add the json reporter to your vitest.config.ts:
export default defineConfig({
test: {
reporters: ['default', 'json'],
outputFile: {
json: 'vitest-results/results.json',
},
},
})Add the workflow step after your test run:
- name: Run unit tests
run: pnpm test:unit
- name: Post Test Results
if: always()
uses: dev-herald/comment@v1
with:
api-key: ${{ secrets.DEV_HERALD_API_KEY }}
pr-number: ${{ github.event.pull_request.number }}
sticky-id: test-results
signal: 'TEST_RESULTS'
test-results: |
- name: Unit Tests
path: vitest-results/results.jsonPlaywright
Add the json reporter to your playwright.config.ts:
export default defineConfig({
reporter: [
['list'],
['json', { outputFile: 'playwright-results/results.json' }],
],
})Add the workflow step after your E2E run:
- name: Run E2E tests
run: pnpm test:e2e
- name: Post Test Results
if: always()
uses: dev-herald/comment@v1
with:
api-key: ${{ secrets.DEV_HERALD_API_KEY }}
pr-number: ${{ github.event.pull_request.number }}
sticky-id: test-results
signal: 'TEST_RESULTS'
test-results: |
- name: E2E Tests
path: playwright-results/results.jsonMultiple suites
Pass multiple suites under the same step — they’ll be combined into a single PR comment:
signal: 'TEST_RESULTS'
test-results: |
- name: Unit Tests
path: vitest-results/results.json
- name: E2E Tests
path: playwright-results/results.jsonSupported test runners
| Runner | Output format |
|---|---|
| Vitest | JSON (reporters: ['json']) |
| Playwright | JSON (reporter: [['json', { outputFile: '...' }]]) |
Next steps
- Learn about Sticky Comments to keep your PR clean
Last updated on