| 85 | } |
| 86 | |
| 87 | function buildTable(title, rows) { |
| 88 | const lines = []; |
| 89 | lines.push(`## ${title}`); |
| 90 | lines.push(''); |
| 91 | |
| 92 | if (rows.length === 0) { |
| 93 | lines.push('None found.'); |
| 94 | lines.push(''); |
| 95 | return lines; |
| 96 | } |
| 97 | |
| 98 | lines.push('| Repository | Last Push | Scope | Status |'); |
| 99 | lines.push('|---|---|---|---|'); |
| 100 | |
| 101 | for (const row of rows) { |
| 102 | const lastPush = row.pushedAt ? row.pushedAt.toISOString().slice(0, 10) : 'unknown'; |
| 103 | const scope = row.isCommunityRepo ? 'Community Projects' : 'README'; |
| 104 | const status = [ |
| 105 | ...(row.archived ? ['archived'] : []), |
| 106 | ...(row.outdated ? ['outdated'] : []), |
| 107 | ].join(', '); |
| 108 | |
| 109 | lines.push(`| [${row.slug}](${row.url}) | ${lastPush} | ${scope} | ${status} |`); |
| 110 | } |
| 111 | |
| 112 | lines.push(''); |
| 113 | return lines; |
| 114 | } |
| 115 | |
| 116 | function buildSummary({ totalReposChecked, archivedFindings, outdatedFindings, cutoffDate }) { |
| 117 | const lines = []; |