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/fix-migration-defaults.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@varlock/bumpy': patch
---

Skip default values (empty arrays, baseBranch: main, etc.) during changeset migration
10 changes: 5 additions & 5 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ bumpy ci plan

**GitHub Actions outputs** (set via `$GITHUB_OUTPUT`):

| Output | Description |
| ---------- | ------------------------------------- |
| `mode` | `version-pr`, `publish`, or `nothing` |
| `packages` | Comma-separated package names |
| `json` | Full JSON output (for `fromJSON()`) |
| Output | Description |
| ---------- | ------------------------------------------------------------- |
| `mode` | `version-pr`, `publish`, or `nothing` |
| `packages` | JSON array of package names (for `fromJSON()` + `contains()`) |
| `json` | Full JSON output (for `fromJSON()`) |

When `ci plan` runs before `ci release` in the same workflow, the plan is cached so `ci release` can skip duplicate registry lookups. The cache is validated against the workspace (package names and versions must match) and deleted after use.

Expand Down
12 changes: 6 additions & 6 deletions docs/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ Publishing often requires expensive build steps that aren't needed when just upd

`ci plan` outputs JSON to stdout, sets GitHub Actions step outputs, and caches the result so that `ci release` can skip duplicate registry lookups in the same workflow run.

| Output | Description |
| ---------- | ------------------------------------- |
| `mode` | `version-pr`, `publish`, or `nothing` |
| `packages` | Comma-separated package names |
| `json` | Full JSON output (for `fromJSON()`) |
| Output | Description |
| ---------- | ------------------------------------------------------------- |
| `mode` | `version-pr`, `publish`, or `nothing` |
| `packages` | JSON array of package names (for `fromJSON()` + `contains()`) |
| `json` | Full JSON output (for `fromJSON()`) |

### Basic: skip builds unless publishing

Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
GH_TOKEN: ${{ github.token }}

# Build only specific packages that are being released
- if: contains(steps.plan.outputs.packages, 'my-expensive-package')
- if: contains(fromJSON(steps.plan.outputs.packages), 'my-expensive-package')
run: bun run build --filter=my-expensive-package
```

Expand Down
2 changes: 1 addition & 1 deletion packages/bumpy/src/commands/ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export async function ciPlanCommand(rootDir: string): Promise<void> {

// Set GitHub Actions outputs
writeGitHubOutput('mode', output.mode);
writeGitHubOutput('packages', output.packageNames.join(','));
writeGitHubOutput('packages', JSON.stringify(output.packageNames));
writeGitHubOutput('json', JSON.stringify(output));
}

Expand Down
11 changes: 8 additions & 3 deletions packages/bumpy/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,14 @@ function migrateChangesetConfig(csConfig: Record<string, unknown>): Record<strin
] as const;

for (const field of migrateableFields) {
if (csConfig[field] !== undefined) {
bumpyConfig[field] = csConfig[field];
}
const value = csConfig[field];
if (value === undefined) continue;
// Skip empty arrays and values that match bumpy defaults — no need to clutter the config
if (Array.isArray(value) && value.length === 0) continue;
if (field === 'baseBranch' && value === 'main') continue;
if (field === 'access' && value === 'public') continue;
if (field === 'updateInternalDependencies' && value === 'out-of-range') continue;
bumpyConfig[field] = value;
}

// Fields intentionally NOT migrated (changesets-only):
Expand Down