Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch name becomes undefined once a release happen in a previous package #152

Open
sznowicki opened this issue Feb 15, 2024 · 1 comment

Comments

@sznowicki
Copy link

sznowicki commented Feb 15, 2024

So I have a setup with 4 different packages in /packages folder.

I noticed that current version can only release one package at a time. Once the release happens (git push, git tag etc.) the branch name becomes undefined and this is what I see in the following release runs:

This test run was triggered on the branch undefined, while semantic-release is configured to only publish from master, next, therefore a new version won’t be published.

I tried running semantic-release from repo root, inside each and every package, and with yarn workspaces run. All have same result.

The job runs within docker image: node:20-bullseye

Release configs are following:

export default {
    "extends": "semantic-release-monorepo",
    message: 'chore: ${nextRelease.version} [skip ci]',
    branches: [
        'master',
        {
            name: 'next',
            prerelease: true,
        },
    ],
    plugins: [
        '@semantic-release/commit-analyzer',
        ['@semantic-release/release-notes-generator', {
            preset: 'conventionalcommits',
        }],
        ['@semantic-release/changelog'],
        ['@semantic-release/npm', {
            npmPublish: true
        }],
        [
            '@semantic-release/git', {
            assets: [
                'CHANGELOG.md',
                'package.json',
                'yarn.lock',
            ],
        },
        ],
    ],
}

Dev dependencies:

 "@commitlint/cli": "^18.6.0",
    "@commitlint/config-conventional": "^18.6.0",
    "@commitlint/format": "^17.6.6",
    "@semantic-release/changelog": "^6.0.3",
    "@semantic-release/commit-analyzer": "^11.1.0",
    "@semantic-release/git": "^10.0.1",
    "@semantic-release/npm": "^11.0.2",
    "@semantic-release/release-notes-generator": "^12.1.0",
    "husky": "^9.0.10",
    "semantic-release": "^23.0.2",
    "semantic-release-monorepo": "^8.0.2"
    ```
@sznowicki
Copy link
Author

Seems like the offender is @semantic-release/git. I guess when it commits and tags the next round looses the branch name.

I'll go with a workaround to have a single CHANGELOG.md then in the root repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant