6

我正在使用语义发布,并且正在尝试使用配置创建预发布

module.exports = {
    branches: [{ name: 'master', prerelease: true }],
    plugins: [
        '@semantic-release/commit-analyzer',
        '@semantic-release/release-notes-generator',
        [
            '@semantic-release/github',
            {
                assets: [ { path: 'dist.zip', label: 'PWA App' } ],
            },
        ],
    ],
};

如您所见,branches它只是一个具有名称和预发布的对象(我也尝试用作数组,同样的问题)

有错误的公共存储库:
https ://github.com/Ridermansb/react-firebase-ssr/runs/813996442?check_suite_focus=true

错误

语义发布“--dry-run”“--debug”

[6:31:02 PM] [semantic-release] › ℹ 运行语义发布版本 17.1.1 [6:31:02 PM] [semantic-release] › ✔ 从“@semantic-release/”加载插件“verifyConditions” github" [6:31:02 PM] [semantic-release] › ✔ 从“@semantic-release/commit-analyzer”加载插件“analyzeCommits” [6:31:02 PM] [semantic-release] › ✔ 加载插件“generateNotes”来自“@semantic-release/release-notes-generator”[6:31:02 PM] [semantic-release] › ✔ 从“@semantic-release/github”加载插件“publish”[6:31: 02 PM] [semantic-release] › ✔ 从“@semantic-release/github”加载插件“addChannel” [6:31:02 PM] [semantic-release] › ✔ 从“@semantic-release”加载插件“success” /github" [6:31:02 PM] [semantic-release] › ✔ 从“@semantic-release/github”加载插件“失败”[6:31:10 PM] [semantic-release] › ⚠ 跳过插件“@semantic-”的步骤“失败”发布/github”在试运行模式下

分支配置( https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#branches)中需要最少 1 个和最多 3 个发布分支。

如果您的存储库没有发布分支(例如 master),则可能会发生这种情况。

您对有问题的分支的配置是 []。

{ AggregateError: SemanticReleaseError: 发布分支在branches配置中无效。在 module.exports (/Users/ridermansb/Projects/meve.ai/web/node_modules/semantic-release/lib/get-error.js:6:10) 在 Object.entries.reduce (/Users/ridermansb/Projects/ meve.ai/web/node_modules/semantic-release/lib/branches/index.js:44:19) 在 Array.reduce () 在 module.exports (/Users/ridermansb/Projects/meve.ai/web/node_modules/ semantic-release/lib/branches/index.js:34:46) 在 module.exports (/Users/ridermansb/Projects/meve.ai/web/node_modules/semantic-release/lib/branches/index.js:66: 11) 在 process._tickCallback (internal/process/next_tick.js:68:7) 名称:'AggregateError'}npm ERR!代码生命周期


我还在语义发布/github语义发布/语义发布repo上创建票证

4

2 回答 2

7

我通过添加 "release": { "branches": [ "master" ] }, package.json 并从 module.exports https://semantic-release.gitbook.io/semantic-release/v/beta/usage/configuration中删除它解决了我的问题

于 2020-11-05T22:26:43.360 回答
1

您需要至少release指定一个分支。此分支需要存在于远程存储库中。

于 2020-11-25T16:58:33.500 回答