semantic-release: error relating to `This test run was triggered on the branch` ... Even though I do have it set as a release branch?

Expected behavior

Environment

  • semantic-release version:
"semantic-release": "^15.14.0",
  • CI environment: docker container
  • Plugins used:
    "@semantic-release/git": "^9.0.0",
    "@semantic-release/gitlab": "^6.0.2",
  • semantic-release configuration:
...
  "release": {
    "branches": ["master", "chris-dev-cicd"],
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      [
        "@semantic-release/npm",
        {
          "npmPublish": true,
          "tarballDir": "dist"
        }
      ],
      "@semantic-release/gitlab"
    ]
  }
...

CI logs:

root@737ce5e924de:/build# npx semantic-release --branches chris-dev-cicd
[9:17:51 PM] [semantic-release] › ℹ  Running semantic-release version 15.14.0
[9:17:51 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
[9:17:51 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/gitlab"
[9:17:51 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[9:17:51 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[9:17:51 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
[9:17:51 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
[9:17:51 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/gitlab"
[9:17:51 PM] [semantic-release] › ⚠  This run was not triggered in a known CI environment, running in dry-run mode.
[9:17:51 PM] [semantic-release] › ℹ  This test run was triggered on the branch chris-dev-cicd, while semantic-release is configured to only publish from master, therefore a new version won’t be published.
root@737ce5e924de:/build# echo $?
0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 16 (1 by maintainers)

Most upvoted comments

As documented here, https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#branches, the branch you want to push should be already there or you will get the error ERELEASEBRANCHES .

After this, it worked for me.

I have the same issue, but my problem is the ‘origin’ prefix: This test run was triggered on the branch origin/beta, while semantic-release is configured to only publish from master, next, homolog, beta, therefore a new version won’t be published.

had the same issue, but in my case, I had a wrong repository property set i package.json. Correcting it solved that.

The --branches option exist only on semantic-release version > 16.

The branches you configure in semantic-release need to exists on the remote repo.