Skip to content

Commit e726f3a

Browse files
theoephraimclaude
andcommitted
Restyle CI check PR comment to use frog images
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d219d71 commit e726f3a

2 files changed

Lines changed: 39 additions & 20 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@varlock/bumpy': patch
3+
---
4+
5+
Restyle CI check PR comment to use frog images matching the version PR description
6+
7+
- Use `frog-talking.png` preamble in the release plan comment
8+
- Use `bumpSectionHeader()` with frog images instead of emoji labels
9+
- Switch from table format to bullet list for consistency with version PR
10+
- Use `frog-neutral.png` in the no-changesets comment

packages/bumpy/src/commands/ci.ts

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -223,25 +223,34 @@ async function createVersionPr(
223223

224224
// ---- PR comment helpers ----
225225

226+
const FROG_IMG_BASE = 'https://raw.githubusercontent.com/dmno-dev/bumpy/main/images';
227+
226228
function formatReleasePlanComment(plan: ReleasePlan, changesetCount: number): string {
227229
const lines: string[] = [];
228-
lines.push('## 🐸 Bumpy Release Plan\n');
229-
lines.push(`**${changesetCount}** changeset(s) → **${plan.releases.length}** package(s) to release\n`);
230-
231-
const groups: [string, PlannedRelease[]][] = [
232-
['🔴 Major', plan.releases.filter((r) => r.type === 'major')],
233-
['🟡 Minor', plan.releases.filter((r) => r.type === 'minor')],
234-
['🟢 Patch', plan.releases.filter((r) => r.type === 'patch')],
235-
];
236-
237-
for (const [label, group] of groups) {
238-
if (group.length === 0) continue;
239-
lines.push(`### ${label}\n`);
240-
lines.push('| Package | Change |');
241-
lines.push('|---------|--------|');
242-
for (const r of group) {
230+
231+
const preamble = [
232+
`<a href="${__BUMPY_WEBSITE_URL__}"><img src="${FROG_IMG_BASE}/frog-talking.png" alt="bumpy-frog" width="60" align="left" style="image-rendering: pixelated;" title="Hi! I'm bumpy!" /></a>`,
233+
'',
234+
`**${changesetCount}** changeset(s) → **${plan.releases.length}** package(s) to release`,
235+
'<br clear="left" />',
236+
].join('\n');
237+
lines.push(preamble);
238+
lines.push('');
239+
240+
const groups: Record<string, PlannedRelease[]> = { major: [], minor: [], patch: [] };
241+
for (const r of plan.releases) {
242+
groups[r.type]?.push(r);
243+
}
244+
245+
for (const type of ['major', 'minor', 'patch'] as const) {
246+
const releases = groups[type];
247+
if (!releases || releases.length === 0) continue;
248+
249+
lines.push(bumpSectionHeader(type));
250+
lines.push('');
251+
for (const r of releases) {
243252
const suffix = r.isDependencyBump ? ' _(dep)_' : r.isCascadeBump ? ' _(cascade)_' : '';
244-
lines.push(`| \`${r.name}\` | ${r.oldVersion} → **${r.newVersion}**${suffix} |`);
253+
lines.push(`- \`${r.name}\` ${r.oldVersion} → **${r.newVersion}**${suffix}`);
245254
}
246255
lines.push('');
247256
}
@@ -253,8 +262,10 @@ function formatReleasePlanComment(plan: ReleasePlan, changesetCount: number): st
253262

254263
function formatNoChangesetsComment(): string {
255264
return [
256-
'## 🐸 Bumpy Release Plan\n',
257-
'No changesets found in this PR. If this PR should trigger a release, run:\n',
265+
`<a href="${__BUMPY_WEBSITE_URL__}"><img src="${FROG_IMG_BASE}/frog-neutral.png" alt="bumpy-frog" width="60" align="left" style="image-rendering: pixelated;" title="Hi! I'm bumpy!" /></a>`,
266+
'',
267+
'No changesets found in this PR. If this PR should trigger a release, run:',
268+
'<br clear="left" />\n',
258269
'```bash',
259270
'bumpy add',
260271
'```\n',
@@ -263,8 +274,6 @@ function formatNoChangesetsComment(): string {
263274
].join('\n');
264275
}
265276

266-
const FROG_IMG_BASE = 'https://raw.githubusercontent.com/dmno-dev/bumpy/main/images';
267-
268277
function bumpSectionHeader(type: string): string {
269278
// I think pixelated css gets stripped but may as well leave it
270279
const frog = `<img src="${FROG_IMG_BASE}/frog-${type}.png" alt="${type}" width="52" style="image-rendering: pixelated;" align="right" />`;

0 commit comments

Comments
 (0)