Simon Zyx
Simon Zyx

Reputation: 7181

Is it possible to only release prereleases with semantic release?

I want to use semantic-release to only publish prereleases.

I have this config in my package.json:

  "release": {
    "branches": [
      {
        "name": "main",
        "prerelease": "alpha",
        "channel": "alpha"
      }
    ]
  }

But if I run npx semantic-release I run into the following error:

ERELEASEBRANCHES The release branches are invalid in the `branches` configuration.
A minimum of 1 and a maximum of 3 release branches are required in the branches configuration (https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#branches).

This may occur if your repository does not have a release branch, such as master.

Your configuration for the problematic branches is [].

As soon as I add another (not prerelease) branch, it works.

Is it possible to only have prerelease branches configured?

Upvotes: 2

Views: 1054

Answers (1)

Simon Zyx
Simon Zyx

Reputation: 7181

I solved this by creating a stable branch that I will not push to. This is not the most elegant solution, but works for now.

Upvotes: 1

Related Questions