Automatic Changelog Generation with semantic-release

Configure semantic-release to automatically create and maintain a CHANGELOG.md file. Uses @semantic-release/changelog and @semantic-release/git to commit the changelog back to the repository.

Basic Configuration

Detailed Explanation

Automatic CHANGELOG.md Generation

Adding a changelog to your semantic-release workflow requires two additional plugins: @semantic-release/changelog to generate the file and @semantic-release/git to commit it back to your repository.

Configuration

{
  "branches": ["main"],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["@semantic-release/changelog", {
      "changelogFile": "CHANGELOG.md"
    }],
    "@semantic-release/npm",
    "@semantic-release/github",
    ["@semantic-release/git", {
      "assets": ["CHANGELOG.md", "package.json", "package-lock.json"],
      "message": "chore(release): ${nextRelease.version} [skip ci]"
    }]
  ]
}

Plugin Order Matters

The order of plugins in the array is critical:

  1. commit-analyzer must come first to determine the release type
  2. release-notes-generator generates the notes used by both changelog and github
  3. changelog writes CHANGELOG.md using the generated notes
  4. npm updates package.json version
  5. github creates the GitHub release
  6. git must come last — it commits all file changes made by previous plugins

The [skip ci] Commit Message

The commit message template includes [skip ci] to prevent the changelog commit from triggering another CI run, which would create an infinite loop. Most CI systems (GitHub Actions, GitLab CI, CircleCI) recognize this flag.

Changelog Format

The generated CHANGELOG.md follows the Keep a Changelog convention with entries grouped by version and sorted by commit type.

Use Case

Projects that want a persistent CHANGELOG.md in their repository for documentation purposes, package registries that display changelogs, or teams that require a change history for compliance and audit trails.

Try It — Semantic Release Config Builder

Open full tool