diff --git a/.bumpy/fix-migration-defaults.md b/.bumpy/fix-migration-defaults.md new file mode 100644 index 0000000..b25ff23 --- /dev/null +++ b/.bumpy/fix-migration-defaults.md @@ -0,0 +1,5 @@ +--- +'@varlock/bumpy': patch +--- + +Skip default values (empty arrays, baseBranch: main, etc.) during changeset migration diff --git a/docs/cli.md b/docs/cli.md index 07bb080..a7740c3 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -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. diff --git a/docs/github-actions.md b/docs/github-actions.md index 25123bf..cd23231 100644 --- a/docs/github-actions.md +++ b/docs/github-actions.md @@ -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 @@ -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 ``` diff --git a/packages/bumpy/src/commands/ci.ts b/packages/bumpy/src/commands/ci.ts index 3931504..96c0b04 100644 --- a/packages/bumpy/src/commands/ci.ts +++ b/packages/bumpy/src/commands/ci.ts @@ -309,7 +309,7 @@ export async function ciPlanCommand(rootDir: string): Promise { // Set GitHub Actions outputs writeGitHubOutput('mode', output.mode); - writeGitHubOutput('packages', output.packageNames.join(',')); + writeGitHubOutput('packages', JSON.stringify(output.packageNames)); writeGitHubOutput('json', JSON.stringify(output)); } diff --git a/packages/bumpy/src/commands/init.ts b/packages/bumpy/src/commands/init.ts index 80a066d..c2774f8 100644 --- a/packages/bumpy/src/commands/init.ts +++ b/packages/bumpy/src/commands/init.ts @@ -171,9 +171,14 @@ function migrateChangesetConfig(csConfig: Record): Record