Skip to content

Commit c91eb77

Browse files
damonbauerclaude
andcommitted
chore(ci): run the coverage report only when a report exists
`always()` ran the coverage action even when `npm ci` or `npm run lint` had already failed. No coverage file exists at that point, so the action failed with ENOENT and became the last red step in the job. That hid the real cause, which is what happened on #126 and #130. `!cancelled()` keeps the useful half of `always()`: the report still runs when the test step fails, which is the point of `reportOnFailure: true` in vitest.config.ts. It drops the half nobody wants, which is running the step after you cancel the job. The `hashFiles` guard skips the step when there is no coverage file to publish. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ttm65yYvBRc7DBwguJW1XE
1 parent e4aad7b commit c91eb77

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
- run: npm run test:coverage
2727

2828
- uses: davelosert/vitest-coverage-report-action@v2
29-
if: always()
29+
if: ${{ !cancelled() && hashFiles('coverage/coverage-summary.json') != '' }}

0 commit comments

Comments
 (0)