Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .bumpy/gmail-dark-mode-and-changelog-tweaks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@varlock/bumpy': patch
---

Fix frog images getting color-inverted in Gmail dark mode by wrapping in anchor tags. Make commit links opt-in via `includeCommitLink` option in GitHub changelog formatter, and add default list of bot/AI authors to skip "Thanks" attribution for.
7 changes: 4 additions & 3 deletions docs/changelog-formatters.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ No options are available for the default formatter.

### `github`

Enhanced formatter that adds PR links, commit links, and contributor attribution. Requires the `gh` CLI to be installed and authenticated.
Enhanced formatter that adds PR links and contributor attribution. Optionally includes commit links. Requires the `gh` CLI to be installed and authenticated.

Enable in your `.bumpy/_config.json` using `"changelog": "github",`

Expand All @@ -44,15 +44,16 @@ Or with options using a tuple format:

_2026-04-19_

- [#42](https://github.com/myorg/myrepo/pull/42) [`abc1234`](https://github.com/myorg/myrepo/commit/abc1234) Thanks [@contributor](https://github.com/contributor)! - Added support for custom themes
- [#43](https://github.com/myorg/myrepo/pull/43) [`def5678`](https://github.com/myorg/myrepo/commit/def5678) - Fixed a bug with config loading
- [#42](https://github.com/myorg/myrepo/pull/42) Thanks [@contributor](https://github.com/contributor)! - Added support for custom themes
- [#43](https://github.com/myorg/myrepo/pull/43) - Fixed a bug with config loading
```

#### Options

| Option | Type | Default | Description |
| ------------------- | ---------- | ------- | ----------------------------------------------------------------- |
| `repo` | `string` | — | `"owner/repo"` slug. Auto-detected from `gh` CLI if not provided. |
| `includeCommitLink` | `boolean` | `false` | Whether to include commit hash links in changelog entries. |
| `thankContributors` | `boolean` | `true` | Whether to include "Thanks @user" messages for contributors. |
| `internalAuthors` | `string[]` | `[]` | GitHub usernames (without `@`) to skip "Thanks" messages for. |

Expand Down
18 changes: 9 additions & 9 deletions packages/bumpy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

_2026-04-22_

- [#36](https://github.com/dmno-dev/bumpy/pull/36) [`43ee7ee`](https://github.com/dmno-dev/bumpy/commit/43ee7eed7e1d80a7b4aafd012b616d93c496a348) - Support JSONC in config file — allows // line comments, block comments, and trailing commas in .bumpy/\_config.json
- [#37](https://github.com/dmno-dev/bumpy/pull/37) [`9b74ae4`](https://github.com/dmno-dev/bumpy/commit/9b74ae4dfb07a3df5ff14c513b88797007d51e9e) - Rework `bumpy check` and `bumpy ci check` behavior: default mode now only fails when no bump files exist at all (matching changesets), new `--strict` flag requires every changed package to be covered, and `--no-fail` makes checks advisory-only. Also fix false positive "empty bump file found" when deleted bump files appear in git diff.
- [#36](https://github.com/dmno-dev/bumpy/pull/36) - Support JSONC in config file — allows // line comments, block comments, and trailing commas in .bumpy/\_config.json
- [#37](https://github.com/dmno-dev/bumpy/pull/37) - Rework `bumpy check` and `bumpy ci check` behavior: default mode now only fails when no bump files exist at all (matching changesets), new `--strict` flag requires every changed package to be covered, and `--no-fail` makes checks advisory-only. Also fix false positive "empty bump file found" when deleted bump files appear in git diff.

## 1.1.0

_2026-04-22_

- [#29](https://github.com/dmno-dev/bumpy/pull/29) [`8a3006f`](https://github.com/dmno-dev/bumpy/commit/8a3006fca143810d71f418a58c65c7a2ee6c0135) - Generate comprehensive README.md in .bumpy/ during init with auto-detected package manager commands
- [#30](https://github.com/dmno-dev/bumpy/pull/30) [`f53a71d`](https://github.com/dmno-dev/bumpy/commit/f53a71d598176182f1a0b4be24d473467a94150f) - Fix check command to only count bump files from current branch, and handle empty bump files correctly in both local and CI check
- [#32](https://github.com/dmno-dev/bumpy/pull/32) [`d800783`](https://github.com/dmno-dev/bumpy/commit/d8007837c80afe1ac5cd383050eb5bffbf440e97) - Fix empty bump files not being deleted during versioning
- [#33](https://github.com/dmno-dev/bumpy/pull/33) [`3b23fcd`](https://github.com/dmno-dev/bumpy/commit/3b23fcd62b366c9ecafb3a10308da9fa45d8c6a0) - Generate command now detects bumps from all commits, not just conventional commits.
- [#34](https://github.com/dmno-dev/bumpy/pull/34) [`ea14829`](https://github.com/dmno-dev/bumpy/commit/ea14829ccb346e05b6d284ff80c0d76d074f25fb) - Add published JSON schema for config file with editor autocomplete/validation. New config options: `changedFilePatterns` (root + per-package) for filtering which file changes trigger package detection, `commit` object form for custom commit messages, and `changelog: false` to disable changelog generation.
- [#35](https://github.com/dmno-dev/bumpy/pull/35) [`3415164`](https://github.com/dmno-dev/bumpy/commit/3415164b9388456e130b14ca21f2c90a042055c6) - Merge migrate command into init — `bumpy init` now auto-detects `.changeset/` and handles migration. Added 🐸 emoji to success messages across all commands.
- [#29](https://github.com/dmno-dev/bumpy/pull/29) - Generate comprehensive README.md in .bumpy/ during init with auto-detected package manager commands
- [#30](https://github.com/dmno-dev/bumpy/pull/30) - Fix check command to only count bump files from current branch, and handle empty bump files correctly in both local and CI check
- [#32](https://github.com/dmno-dev/bumpy/pull/32) - Fix empty bump files not being deleted during versioning
- [#33](https://github.com/dmno-dev/bumpy/pull/33) - Generate command now detects bumps from all commits, not just conventional commits.
- [#34](https://github.com/dmno-dev/bumpy/pull/34) - Add published JSON schema for config file with editor autocomplete/validation. New config options: `changedFilePatterns` (root + per-package) for filtering which file changes trigger package detection, `commit` object form for custom commit messages, and `changelog: false` to disable changelog generation.
- [#35](https://github.com/dmno-dev/bumpy/pull/35) - Merge migrate command into init — `bumpy init` now auto-detects `.changeset/` and handles migration. Added 🐸 emoji to success messages across all commands.

## 🎉 1.0.0 <img src="https://raw.githubusercontent.com/dmno-dev/bumpy/main/images/frog-party.png" alt="bumpy-frog-party" width="80" style="image-rendering: pixelated;" align="right" />

Expand All @@ -27,7 +27,7 @@ Initial stable release of bumpy — a modern monorepo versioning and changelog t
- Flexible dependency bump propagation with cascade control
- Fixed and linked package group strategies
- Flexible opt-in out for packages, custom deployment commands
- Pluggable changelog formatters with built-in GitHub formatter (PR links, commit links, contributor attribution)
- Pluggable changelog formatters with built-in GitHub formatter (PR links, optional commit links, contributor attribution)
- Interactive and non-interactive changeset creation (`bumpy add`)
- Conventional commits bridge for automatic changeset generation
- GitHub CI integration for PR checks and automated releases (`bumpy ci check`, `bumpy ci release`)
Expand Down
6 changes: 4 additions & 2 deletions packages/bumpy/src/commands/ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,10 @@ function formatNoBumpFilesComment(prBranch: string | null, pm: PackageManager):

function bumpSectionHeader(type: string): string {
// I think pixelated css gets stripped but may as well leave it
const frog = `<img src="${FROG_IMG_BASE}/frog-${type}.png" alt="${type}" width="52" style="image-rendering: pixelated;" align="right" />`;
return `### ${frog} ${type.charAt(0).toUpperCase() + type.slice(1)} releases`;
// wrapping in <a> prevents Gmail dark mode from inverting the image
const label = `${type.charAt(0).toUpperCase() + type.slice(1)} releases`;
const frog = `<a href="https://bumpy.varlock.dev" title="${label}"><img src="${FROG_IMG_BASE}/frog-${type}.png" alt="${type}" width="52" style="image-rendering: pixelated;" align="right" /></a>`;
return `### ${frog} ${label}`;
}

/** Build inline diff links for a package's changed files in the PR */
Expand Down
36 changes: 32 additions & 4 deletions packages/bumpy/src/core/changelog-github.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
import { tryRunArgs } from '../utils/shell.ts';
import type { ChangelogContext, ChangelogFormatter } from './changelog.ts';

/** Authors filtered from "Thanks" attribution by default (e.g. bots) */
/** Authors filtered from "Thanks" attribution by default (e.g. AI/automation bots) */
const DEFAULT_INTERNAL_AUTHORS = [
'copilot',
'app/copilot-swe-agent',
'claude',
'dependabot',
'dependabot[bot]',
'app/dependabot',
'renovate[bot]',
'app/renovate',
'github-actions[bot]',
'snyk-bot',
];

export interface GithubChangelogOptions {
/** "owner/repo" — auto-detected from gh CLI if not provided */
repo?: string;
/** Whether to include commit hash links in changelog entries (default: false) */
includeCommitLink?: boolean;
/** Whether to include "Thanks @user" messages for contributors (default: true) */
thankContributors?: boolean;
/** GitHub usernames (without @) to skip "Thanks" messages for (e.g. internal team members) */
Expand All @@ -12,7 +29,7 @@ export interface GithubChangelogOptions {

/**
* GitHub-enhanced changelog formatter.
* Adds PR links, commit links, and contributor attribution when git/gh info is available.
* Adds PR links, contributor attribution, and optionally commit links when git/gh info is available.
*
* Usage in config:
* "changelog": "github"
Expand All @@ -21,8 +38,11 @@ export interface GithubChangelogOptions {
* "changelog": ["github", { "internalAuthors": ["theoephraim"] }]
*/
export function createGithubFormatter(options: GithubChangelogOptions = {}): ChangelogFormatter {
const includeCommitLink = options.includeCommitLink ?? false;
const thankContributors = options.thankContributors ?? true;
const internalAuthorsSet = new Set((options.internalAuthors ?? []).map((a) => a.toLowerCase()));
const internalAuthorsSet = new Set(
[...DEFAULT_INTERNAL_AUTHORS, ...(options.internalAuthors ?? [])].map((a) => a.toLowerCase()),
);

return async (ctx: ChangelogContext) => {
const { release, bumpFiles, date } = ctx;
Expand Down Expand Up @@ -51,7 +71,14 @@ export function createGithubFormatter(options: GithubChangelogOptions = {}): Cha
const firstLine = linkifyIssueRefs(summaryLines[0]!, serverUrl, repoSlug);

// Build the prefix: PR link, commit link, thanks
const prefix = formatPrefix(gitInfo, serverUrl, repoSlug, thankContributors, internalAuthorsSet);
const prefix = formatPrefix(
gitInfo,
serverUrl,
repoSlug,
includeCommitLink,
thankContributors,
internalAuthorsSet,
);

lines.push(`-${prefix ? ` ${prefix} -` : ''} ${firstLine}`);

Expand Down Expand Up @@ -243,6 +270,7 @@ function formatPrefix(
info: BumpFileGitInfo,
serverUrl: string,
repo: string | undefined,
includeCommitLink: boolean,
thankContributors: boolean,
internalAuthors: Set<string>,
): string {
Expand All @@ -252,7 +280,7 @@ function formatPrefix(
parts.push(`[#${info.prNumber}](${info.prUrl})`);
}

if (info.commitHash && repo) {
if (includeCommitLink && info.commitHash && repo) {
const short = info.commitHash.slice(0, 7);
parts.push(`[\`${short}\`](${serverUrl}/${repo}/commit/${info.commitHash})`);
}
Expand Down
17 changes: 15 additions & 2 deletions packages/bumpy/test/core/changelog-github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('createGithubFormatter', () => {
expect(result).toContain('https://github.com/dmno-dev/bumpy/pull/42');
});

test('includes commit link when bump file has commit metadata', async () => {
test('excludes commit link by default', async () => {
addMockRule({ match: /^git log/, response: '' });

const formatter = createGithubFormatter({ repo: 'dmno-dev/bumpy' });
Expand All @@ -60,6 +60,19 @@ describe('createGithubFormatter', () => {

const result = await formatter({ release, bumpFiles, date: '2026-04-14' });

expect(result).not.toContain('[`abc1234`]');
expect(result).not.toContain('/commit/abc1234567890');
});

test('includes commit link when includeCommitLink is true', async () => {
addMockRule({ match: /^git log/, response: '' });

const formatter = createGithubFormatter({ repo: 'dmno-dev/bumpy', includeCommitLink: true });
const release = makeRelease('pkg-a', '1.0.1', { bumpFiles: ['cs1'] });
const bumpFiles = [makeBumpFile('cs1', [{ name: 'pkg-a', type: 'patch' }], 'commit: abc1234567890\nFixed it')];

const result = await formatter({ release, bumpFiles, date: '2026-04-14' });

expect(result).toContain('[`abc1234`]');
expect(result).toContain('/commit/abc1234567890');
});
Expand Down Expand Up @@ -167,7 +180,7 @@ describe('createGithubFormatter', () => {
const result = await formatter({ release, bumpFiles, date: '2026-04-14' });

expect(result).toContain('[#99]');
expect(result).toContain('[`deadbee`]');
expect(result).not.toContain('[`deadbee`]');
expect(result).toContain('Thanks [@contributor]');
});

Expand Down