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

Question: Merging pre-release branches & generated changelog #606

Open
fjakop opened this issue Feb 21, 2024 · 0 comments
Open

Question: Merging pre-release branches & generated changelog #606

fjakop opened this issue Feb 21, 2024 · 0 comments

Comments

@fjakop
Copy link

fjakop commented Feb 21, 2024

We're using semantic-release in our projects with many collaborators. When we develop a new feature we're creating a pre-release branch which publishes to a dist-tag named according to this branch name, so other developers can use it.

Let's say we develop feature-foo, we get pre-releases with dist-tag @feature-foo and tags x.y.z-feature-foo.1 and so on (x.y.z is the previous release version on that branch).

Since we have activated semantic-release/changelog in our .releaserc.json (see below), every pre-release will get a changelog entry according to its commit comments and a release header like this:

CHANGELOG.md

### Features

*  My commit comment 2 ([d762374](link omitted))

# [x.y.z-feature-foo.2](link omitted) (2024-2-14)


### Features

*  My commit comment 1 ([4e6731c](link omitted))

# [x.y.z-feature-foo.1](link omitted) (2024-2-14)

Now when the feature is finished, we merge the feature branch by Gitlab Mmerge request to the main branch. This causes the changelog file and every pre-release entry to be merged into the main branch changelog too, which clutters the changelog and is clearly not desired.

Now the questions:

  • How is this intended to be handled?
  • Has someone else the same problem?
  • Are we doing something strange/wrong?

Kind regards
Frank

.releaserc.json

{
  "branches": [
    {"name": "feature-([0-9A-Za-z-]+)", "prerelease": true},
  ],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/changelog",
    "@semantic-release/gitlab",
    "@semantic-release/npm",
    [
      "@semantic-release/git",
      {
        "assets": ["package.json", "CHANGELOG.md"],
        "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
      }
    ]
  ]
}
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