question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Branch is setup to *not* be a prerelease, yet the release is flagged as 'pre-release'.

See original GitHub issue
{
  "branches": [
    {
      "name": "main",
      "prerelease": false
    },
    {
      "name": "development",
      "prerelease": true
    },
    {
      "name": "staging",
      "prerelease": false
    }
  ],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/github"
  ]
}

This config does not throw an error, but behaves inconsistent. Pushing to staging does not create a release, but a pre-release.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
diogokisscommented, May 9, 2022

Same here. 😢

1reaction
aslafy-zcommented, Jun 16, 2022

It may be due to this check: https://github.com/semantic-release/github/blob/master/lib/is-prerelease.js#L1. It tags as pre-release any branch marked as pre-release, or any branch marked as release and not tagged as main. As per https://github.com/semantic-release/semantic-release/blob/971a5e0d16f1a32e117e9ce382a1618c8256d0d9/lib/branches/normalize.js#L87, it looks like there can be only one main tagged branch, thus, only one branch not beeing used as pre-release (in the case of the GitHub plugin). I was not able to find references with multiple main branches, see https://github.com/semantic-release/semantic-release/blob/971a5e0d16f1a32e117e9ce382a1618c8256d0d9/test/branches/normalize.test.js#L150.

This issue was introduced with https://github.com/semantic-release/github/pull/235.

Possible workaround

In my case I’m defining two branches objects:

  branches: [
    'release/+([0-9])?(.{+([0-9]),x}).x',
    'master',
  ],

Moving the master branch first should prevent pre-releases from being created for this branch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`next` - Intuit
Calling the next command from a prerelease branch will publish a prerelease for just that branch, otherwise it will publish to the default...
Read more >
@lerna/version - npm
Running lerna version --conventional-commits without the above flags will release current changes as prerelease only if the version is already in prerelease ......
Read more >
Adobe Experience Manager as a Cloud Service Prerelease ...
Each release is accompanied by release notes that document not only what is new in that release, but also the features that are...
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. Introduction. In the world of software ...
Read more >
Create release - Octopus Deploy
--packagePrerelease=VALUE [Optional] Pre-release for latest version of ... Flag] Perform a dry run but don't actually create/deploy release.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found