Skip to content

Please anyone helps me to setup custom template for changelog #397

@MDmubarak786

Description

@MDmubarak786

Package.json file

{
  "name": "test",
  "version": "1.6.1",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "14.2.5",
    "react": "^18",
    "react-dom": "^18"
  },
  "devDependencies": {
    "@semantic-release/changelog": "^6.0.3",
    "@semantic-release/commit-analyzer": "^13.0.0",
    "@semantic-release/exec": "^6.0.3",
    "@semantic-release/git": "^10.0.1",
    "@semantic-release/github": "^10.1.5",
    "@semantic-release/npm": "^12.0.1",
    "@semantic-release/release-notes-generator": "^14.0.1",
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "commitizen": "^4.3.0",
    "conventional-changelog-conventionalcommits": "^8.0.0",
    "cz-conventional-changelog": "^3.3.0",
    "eslint": "^8",
    "eslint-config-next": "14.2.5",
    "postcss": "^8",
    "semantic-release": "^24.0.0",
    "tailwindcss": "^3.4.1",
    "typescript": "^5"
  },
  "release": {
    "plugins": [
      "@semantic-release/commit-analyzer",
      [
        "@semantic-release/release-notes-generator",
        {
          "writerOpts": {
            "mainTemplate": "./changelog-template.hbs"
          }
        }
      ],
      [
        "@semantic-release/changelog",
        {
          "changelogTitle": "# 🚀 Release Notes",
          "changelogFile": "CHANGELOG.md"
        }
      ],
      "@semantic-release/git",
      "@semantic-release/github"
    ]
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}

This is template file

# 🚀 Release Notes

{{#if version}}
## 📦 Version {{version}}
{{/if}}

{{#if date}}Released on: {{date}}
{{/if}}

{{#if commits}}
##  Commits

{{#each commits}}
- {{#if this.breaking}}💥 BREAKING CHANGE: {{/if}}{{#if this.type}}({{this.type}}) {{/if}}{{this.scope}}:
{{this.subject}}
{{/each}}
{{/if}}

{{#if noteGroups}}
## 📋 Notes

{{#each noteGroups}}
### {{title}}

{{#each notes}}
- {{text}}
{{/each}}

{{/each}}
{{/if}}

{{#if issues}}
## 🐛 Fixed Issues

{{#each issues}}
- {{this}}
{{/each}}
{{/if}}

{{#if merges}}
## 🔀 Merged Pull Requests

{{#each merges}}
- {{this}}
{{/each}}
{{/if}}

Please let me know what I might be missing—my template changes aren't reflecting in the changelog.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions