name: PR Health rollup # Adapted for tasks (Echodo): single-job CI (Lint, type-check, test), # Coolify deploy (no per-PR preview), Drizzle (no Prisma schema-map drift). # # Coolify does NOT post a check to GitHub on deploy by default — there's no # "build" row to read from a third-party check. The build itself happens AFTER # merge, on Coolify's runner. on: pull_request: branches: [main] types: [opened, synchronize, reopened, labeled, unlabeled] workflow_run: workflows: [CI] types: [completed] permissions: pull-requests: write issues: write checks: read jobs: rollup: name: Aggregate gate status runs-on: ubuntu-latest steps: - name: Compute status + post sticky comment uses: actions/github-script@v7 with: script: | const { owner, repo } = context.repo; const pr_number = context.payload.pull_request?.number ?? context.payload.workflow_run?.pull_requests?.[0]?.number; if (!pr_number) { core.info('No PR context — skipping rollup.'); return; } const pr = (await github.rest.pulls.get({ owner, repo, pull_number: pr_number })).data; const sha = pr.head.sha; const checks = (await github.rest.checks.listForRef({ owner, repo, ref: sha, per_page: 100 })).data.check_runs; const find = (name) => checks.find(c => c.name === name); const skip = (flag) => new RegExp(`pipeline:.*skip[^\\n]*\\b${flag}\\b`).test(pr.body || ''); const row = (label, run, opt = false) => { if (!run) return `| ${label} | ${opt ? '⏭ skipped or pending' : '⏳ pending'} |`; if (run.status !== 'completed') return `| ${label} | ⏳ in progress |`; const ok = run.conclusion === 'success'; return `| ${label} | ${ok ? '✅ pass' : '❌ ' + run.conclusion} |`; }; const rows = [ row('CI: Lint, type-check, test', find('Lint, type-check, test')), ]; const comments = (await github.rest.issues.listComments({ owner, repo, issue_number: pr_number, per_page: 100, })).data; const reviewer_comment = comments.find(c => c.body?.startsWith('## Reviewer Report')); const a11y_comment = comments.find(c => c.body?.startsWith('## A11y Audit')); const ds_comment = comments.find(c => c.body?.startsWith('## Design System Audit')); const role_row = (label, c, skipped) => skipped ? `| ${label} | ⏭ skipped |` : c ? `| ${label} | ✅ posted |` : `| ${label} | ⏳ pending |`; const role_rows = [ role_row('Reviewer report', reviewer_comment, skip('review')), role_row('A11y audit', a11y_comment, skip('a11y')), role_row('Design system audit', ds_comment, skip('design')), ]; const marker = ''; const body = `${marker}\n## Pipeline Health\n\n### CI gates\n\n| Gate | Status |\n| --- | --- |\n${rows.join('\n')}\n\n_Build runs on Coolify post-merge; this CI runs lint + type-check + tests only. No per-PR preview URL by default._\n\n### Role reports\n\n| Role | Status |\n| --- | --- |\n${role_rows.join('\n')}\n\nSee individual comments above for details. This rollup updates automatically.`; const existing = comments.find(c => c.body?.startsWith(marker)); if (existing) { await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body }); } else { await github.rest.issues.createComment({ owner, repo, issue_number: pr_number, body }); }