Skip to content

Custom commitPartial ends with empty {{commitUrlFormat}} #288

@JellyO1

Description

@JellyO1

Describe the bug
Overriding the writerOps:commitPartial somehow strips the {{commitUrlFormat}} information.

const commitPartial = `* {{#if subject}}
  {{~subject}}
{{~else}}
  {{~header}}
{{~/if}}

{{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}}
  ([{{shortHash}}]({{commitUrlFormat}}))
{{~else}}
  {{~shortHash}}
{{~/if}}{{~/if}}

{{~!-- commit references --}}
{{~#if references~}}
  , closes
  {{~#each references}} {{#if @root.linkReferences~}}
    [
    {{~#if this.owner}}
      {{~this.owner}}/
    {{~/if}}
    {{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
  {{~else}}
    {{~#if this.owner}}
      {{~this.owner}}/
    {{~/if}}
    {{~this.repository}}{{this.prefix}}{{this.issue}}
  {{~/if}}{{/each}}
{{~/if}}

`;

module.exports = {
	writerOpts: {
		commitPartial: commitPartial,
	},
};

Current behavior
The commit messages end up with commit description ([#hash]())

Expected behavior
The commit messages should end up with commit description ([#hash](commiturl))

Environment

  • commit-and-tag-version version(s): 12.7.1
  • Node/npm version: Node 22.17.1, npm 11.10.0
  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions