Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WhatBump returning undefined skips release #102

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

Blackclaws
Copy link
Contributor

@Blackclaws Blackclaws commented Oct 16, 2024

This pull request adds support for whatBump returning undefined leading to no release being made.

Copy link

pkg-pr-new bot commented Oct 16, 2024

Open in Stackblitz

yarn add https://pkg.pr.new/@release-it/[email protected]

commit: ff1f342

@Blackclaws Blackclaws changed the title Two fixes, whatbump undefined releaseType, base tag of last stable WhatBump returning undefined skips release Oct 17, 2024
@oluwatobiss
Copy link
Contributor

oluwatobiss commented Oct 18, 2024

Although this PR is a handy option for running release-it without releasing any version, it does not resolve instances where a version release is necessary. It will also require using a non-JSON config file to support passing a function to whatBump. Otherwise, #101's ERROR whatBump is not a function error will persist.

Why don't we pass a function directly into await bumper.bump() and allow the releaseType to accept undefined or the bump version (patch, minor, or major). So something like this:

const bumpVersion = 'patch'; // I've yet to figure out how to get the bump version.
const result = await bumper.bump(async () => {
   return { releaseType: options.whatBump == 'undefined' ? undefined : bumpVersion }
});

By so doing, we can use any config file since options.whatBump no longer needs to be a function. Here's a JSON example:

{
  "plugins": {
    "@release-it/conventional-changelog": {
      "preset": "conventionalcommits",
      "whatBump": "undefined"
    }
  }
}

@webpro
Copy link
Contributor

webpro commented Oct 21, 2024

@Blackclaws Thanks! Will release shortly.

@oluwatobiss Feel free to open a ticket or PR and we can take it from there.

@webpro webpro merged commit 3301fbe into release-it:master Oct 21, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants