( prBranch: string | null, pm: PackageManager, willFail = false, changedPackages: string[] = [], )
| 1517 | '', |
| 1518 | '**This PR includes an empty bump file — no version bump is needed.** :white_check_mark:', |
| 1519 | '<br clear="left" />', |
| 1520 | '', |
| 1521 | ]; |
| 1522 | |
| 1523 | for (const id of emptyBumpFileIds) { |
| 1524 | const filename = `${id}.md`; |
| 1525 | const parts: string[] = [`\`${filename}\``]; |
| 1526 | if (repo) { |
| 1527 | parts.push( |
| 1528 | `([view diff](https://github.com/${repo}/pull/${prNumber}/changes#diff-${sha256Hex(`.bumpy/${filename}`)}))`, |
| 1529 | ); |
| 1530 | if (prBranch) { |
| 1531 | parts.push(`([edit](https://github.com/${repo}/edit/${prBranch}/.bumpy/${filename}))`); |
| 1532 | } |
| 1533 | } |
| 1534 | lines.push(`- ${parts.join(' ')}`); |
| 1535 | } |
| 1536 | |
| 1537 | lines.push('\n---'); |
| 1538 | lines.push(`_This comment is maintained by [bumpy](https://bumpy.varlock.dev)._`); |
| 1539 | return lines.join('\n'); |
| 1540 | } |
| 1541 | |
| 1542 | /** |
| 1543 | * Comment for a PR with no bump files. |
| 1544 | * |
| 1545 | * When the check will fail (the default/strict modes, given changed packages), the |
| 1546 | * comment must NOT say "you're good to go" — that contradicts the failing status. |
| 1547 | * Instead it explains that a bump file is required and points at the empty bump file |
| 1548 | * as the way to acknowledge an intentional no-release (e.g. a dependency-only PR). |
| 1549 | * In `--no-fail` mode the check passes, so the friendlier wording is accurate. |
| 1550 | */ |
| 1551 | export function formatNoBumpFilesComment( |
| 1552 | prBranch: string | null, |
| 1553 | pm: PackageManager, |
| 1554 | willFail = false, |
| 1555 | changedPackages: string[] = [], |
| 1556 | ): string { |
| 1557 | const runCmd = pmRunCommand(pm); |
| 1558 | const addLink = buildAddBumpFileLink(prBranch); |
| 1559 | const emptyLink = buildAddEmptyBumpFileLink(prBranch); |
| 1560 | |
| 1561 | if (!willFail) { |
| 1562 | const lines = [ |
| 1563 | `<a href="https://bumpy.varlock.dev"><img src="${FROG_IMG_BASE}/frog-warning.png" alt="bumpy-frog" width="60" align="left" style="image-rendering: pixelated;" title="Hi! I'm bumpy!" /></a>`, |
| 1564 | '', |
| 1565 | "Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a bump file.**", |
| 1566 | '<br clear="left" />\n', |
| 1567 | 'You can add a bump file by running:\n', |
| 1568 | '```bash', |
| 1569 | `${runCmd} add`, |
| 1570 | '```', |
| 1571 | ]; |
| 1572 | if (addLink) { |
| 1573 | lines.push(''); |
| 1574 | lines.push(`Or [click here to add a bump file](${addLink}) directly on GitHub.`); |
| 1575 | } |
| 1576 | lines.push('\n---'); |
no test coverage detected
searching dependent graphs…