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.

prerelease config causing errors

See original GitHub issue

With configuration

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',
                    },
                ],
            },
        ],
    ],
};

semantic-release “–dry-run” “–debug”

[6:31:02 PM] [semantic-release] › ℹ Running semantic-release version 17.1.1 [6:31:02 PM] [semantic-release] › ✔ Loaded plugin “verifyConditions” from “@semantic-release/github” [6:31:02 PM] [semantic-release] › ✔ Loaded plugin “analyzeCommits” from “@semantic-release/commit-analyzer” [6:31:02 PM] [semantic-release] › ✔ Loaded plugin “generateNotes” from “@semantic-release/release-notes-generator” [6:31:02 PM] [semantic-release] › ✔ Loaded plugin “publish” from “@semantic-release/github” [6:31:02 PM] [semantic-release] › ✔ Loaded plugin “addChannel” from “@semantic-release/github” [6:31:02 PM] [semantic-release] › ✔ Loaded plugin “success” from “@semantic-release/github” [6:31:02 PM] [semantic-release] › ✔ Loaded plugin “fail” from “@semantic-release/github” [6:31:10 PM] [semantic-release] › ⚠ Skip step “fail” of plugin “@semantic-release/github” in dry-run mode

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

{ AggregateError: SemanticReleaseError: The release branches are invalid in the branches configuration. at module.exports (/Users/ridermansb/Projects/meve.ai/web/node_modules/semantic-release/lib/get-error.js:6:10) at Object.entries.reduce (/Users/ridermansb/Projects/meve.ai/web/node_modules/semantic-release/lib/branches/index.js:44:19) at Array.reduce (<anonymous>) at module.exports (/Users/ridermansb/Projects/meve.ai/web/node_modules/semantic-release/lib/branches/index.js:34:46) at module.exports (/Users/ridermansb/Projects/meve.ai/web/node_modules/semantic-release/lib/branches/index.js:66:11) at process._tickCallback (internal/process/next_tick.js:68:7) name: ‘AggregateError’ }npm ERR! code ELIFECYCLE

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
travicommented, Jan 28, 2022

The problem is that if we create a stable branch in the template, semantic-release will automatically publish a 1.0.0 stable release right after using the template.

this is only true if the commit uses type feat, fix, or perf (assuming you are using the default configuration). if there are no commits in the history of the branch that should result in a new version, no release will be published.

This check doesn’t make any sense at all.

please do not make statements like this without complete information. i’ve given some explanation around the reason behind this requirement in response to the issue you opened in https://github.com/semantic-release/semantic-release/issues/2345#issuecomment-1024352411. in the future, it would be appreciated if you gather agreement from the maintainers before deciding that existing checks provide no value and opening a PR to remove.

1reaction
ccjjmartincommented, Jan 15, 2021

I would recommend closing this issue, I am using prerelease config just fine with the latest version and at at least one named branch that isn’t a prerelease branch. Here is my working config in release.config.js (maybe other file names are causing this issue though?):

module.exports = {
  branches: [
    '+([0-9])?(.{+([0-9]),x}).x',
    'stable',
    {name: 'rc', prerelease: true},
    {name: 'beta', prerelease: true},
    {name: 'alpha', prerelease: true}
  ],
  plugins: [
    ['@semantic-release/commit-analyzer'],
    '@semantic-release/release-notes-generator',
    [
      '@semantic-release/changelog',
      {
        changelogFile: 'CHANGELOG.md',
      },
    ],
    '@semantic-release/git',
    "@semantic-release/github",
  ],
};

For anyone who is curious this code '+([0-9])?(.{+([0-9]),x}).x', is for maintenance branches like 1.x or 2.1.x, they do need to end in an x.

Read more comments on GitHub >

github_iconTop Results From Across the Web

#21953 Feedback on errors occurring when moving from pre ...
Feedback on errors occurring when moving from pre-release to stable ... I tracked it down to a rogue app.config file with bad assembly...
Read more >
Semantic-Release - pre-release version not incrementing for ...
I had been encountering the same behavior and went spelunking into the source of semantic-release . At v17.0.3 semantic-release switched to ...
Read more >
Workflow configuration - Semantic Release - GitBook
Workflow configuration. semantic-release allow to manage and automate complex release workflow, based on multiple Git branches and distribution channels.
Read more >
R2023a Prerelease Key Known Issues - MATLAB & Simulink
Description: Errors and warnings appear when using the hardware setup screens for third-party tool configuration. This is caused by a ...
Read more >
How to troubleshoot NPM problems - JFrog
It has several unique API calls that may cause errors if not properly handled by Artifactory. When troubleshooting these errors, ...
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