首页 > 解决方案 > 是否可以只发布带有语义发布的预发布?

问题描述

我想使用语义发布只发布预发布。

我有这个配置在我的package.json

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

但是如果我运行npx semantic-release我会遇到以下错误:

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 [].

只要我添加另一个(不是预发布)分支,它就可以工作。

是否可以只配置预发布分支?

标签: semantic-release

解决方案


我通过创建一个我不会推送的稳定分支解决了这个问题。这不是最优雅的解决方案,但目前有效。


推荐阅读