Skip to content

docs(knowledge): sync services README after drift-report-format change #220

docs(knowledge): sync services README after drift-report-format change

docs(knowledge): sync services README after drift-report-format change #220

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: pnpm run typecheck
- run: pnpm run build
- run: pnpm run test:coverage
- name: Compose coverage comment
if: always()
# body is built only from .total numeric fields + fixed metric names —
# no file paths or user strings, so it carries no markdown-injection vector
shell: bash
run: |
{
echo '## Test Coverage'
echo
if [ -f coverage/coverage-summary.json ]; then
echo '| Metric | Coverage | Covered / Total |'
echo '| --- | --- | --- |'
jq -r '
.total
| to_entries[]
| select(.key=="statements" or .key=="branches" or .key=="functions" or .key=="lines")
| "| \(.key) | \(.value.pct)% | \(.value.covered) / \(.value.total) |"
' coverage/coverage-summary.json
else
echo '_coverage summary not found (the test step may have failed before producing coverage)._'
fi
} > coverage-comment.md
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: |
coverage-comment.md
coverage/coverage-summary.json
if-no-files-found: ignore
comment:
if: always() && github.event_name == 'pull_request'
needs: test
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Download coverage report
continue-on-error: true
uses: actions/download-artifact@v8
with:
name: coverage-report
- name: Ensure comment body exists
shell: bash
run: |
if [ ! -f coverage-comment.md ]; then
printf '## Test Coverage\n\n_coverage report unavailable (the test job may have failed before producing coverage)._\n' > coverage-comment.md
fi
- name: Post sticky PR comment
uses: marocchino/sticky-pull-request-comment@v3
with:
header: coverage
path: coverage-comment.md