dhoulb / multi-semantic-release

Proof of concept that wraps semantic-release to work with monorepos.
BSD Zero Clause License
203 stars 36 forks source link

ERELEASEBRANCHES The release branches are invalid in the `branches` configuration. #114

Open khawarizmus opened 2 years ago

khawarizmus commented 2 years ago

As the title suggests i am getting this error when i run yarn multi-semantic-release --debug --dry-run the output is as follows:

multi-semantic-release version: 2.12.0
semantic-release version: 17.4.7
flags: {
  "debug": true,
  "dryRun": true,
  "sequentialInit": false,
  "firstParent": false,
  "deps": {
    "bump": "override",
    "release": "patch"
  },
  "ignorePrivatePackages": false
}
package paths [
  '/Users/Pocoyo/projects/bzness/bzness-back/apps/admin/package.json',
  '/Users/Pocoyo/projects/bzness/bzness-back/apps/api/package.json'
]
[01:04:05] › 🎉  Started multirelease! Loading 2 packages...
[01:04:05] › ✔  Loaded package admin
[01:04:05] › ✔  Loaded package api
[01:04:05] › 🎉  Queued 2 packages! Starting release...
  msr:inlinePlugin inlinePlugin created: admin +0ms
[01:04:05] [admin] › ℹ  Running semantic-release version 17.4.7
  msr:inlinePlugin inlinePlugin created: api +26ms
[01:04:05] [api] › ℹ  Running semantic-release version 17.4.7
[01:04:05] [admin] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[01:04:05] [admin] › ✔  Loaded plugin "success" from "@semantic-release/github"
[01:04:05] [admin] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[01:04:05] [api] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[01:04:05] [api] › ✔  Loaded plugin "success" from "@semantic-release/github"
[01:04:05] [api] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[01:04:14] [api] › ⚠  Skip step "fail" of plugin "@semantic-release/github" in dry-run mode
[01:04:14] [api] › ✖  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 [].

[multi-semantic-release]: AggregateError: 
    SemanticReleaseError: The release branches are invalid in the `branches` configuration.
        at module.exports .....

I have set up a global .releaserc.json with the following configuration:

{
  "branches": ["master", "next"],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/github",
    "@semantic-release/git",
    "@semantic-release/changelog"
  ]
}

then to be sure i added a local config in each packages containing the following configuration:

{
  "branches": ["master", "next"]
}

Any idea whay it's not detecting the branchs prorety in the config?

luokuning commented 2 years ago

This error is getting from semantic-release, it looks like you repositoryUrl or repository.url in package.json file is not a valid repo.