Skip to content

buildStatusTable

Builds a Markdown table body from a map of job names to CI/CD statuses. Each row follows the format | icon | **Job Name** | badge |.

Intended to be embedded in a PR comment template:

| | Job | Status |
|:---:|-----|:------:|
${buildStatusTable(jobs)}

Available since v2.0.0

import { buildStatusTable } from '@helpers4/ci';
buildStatusTable(jobs: Record<string, string>): string
ParameterTypeDescription
jobsRecord<string, string>Record mapping job display names to their CI status

string — Newline-separated Markdown table rows (no header, no footer)

Generates the body rows of a Markdown table for a PR validation summary.

const rows = buildStatusTable({
  '🧾 Conventional Commits': 'success',
  '🐚 ShellCheck':           'failure',
  '🧪 Tests':                'skipped',
});

// Embed in a comment template:
// | | Job | Status |
// |:---:|-----|:------:|
// ${rows}

View source on GitHub