Skip to content

Adding ReleaseRules types list is working fine with release versioning but Changelog commits are empty. #234

@isabr85

Description

@isabr85

I've added to @semantic-release/commit-analyzer plugin a list of types under releaseRules:

module.exports = {
    branches: [
        '+([0-9])?(.{+([0-9]),x}).x',
        'main', 
        'dev',
	'master'
    ],
    plugins: [
		["@semantic-release/commit-analyzer", {
		  preset: "angular",
		  releaseRules: [
			{type: "docs", release: "patch"},
			{type: "refactor", release: "patch"},
			{type: "ci", release: "patch"},
			{type: "style", release: "patch"},
			{type: "test", release: "patch"},
			{type: "chore", release: "patch"}
		  ]
		}],
        ['@semantic-release/release-notes-generator', {
            writerOpts: {
                finalizeContext: function (context) {
                    return {
                        ...context,
                        repository: 'myRepository',
                        owner: 'ownerName',
                        repoUrl: 'https://dev.azure.com',
                        commit: '_git/projectName/commit',
                        linkCompare: false
                    };
                }
            },
            host: 'https://dev.azure.com',
            issue: '_workitems/edit'
        }],
        '@semantic-release/changelog'
    ],
    prepare: [
        ["@semantic-release/exec", {
            "prepareCmd": 'echo ##vso[task.setvariable variable=nextRelease]${nextRelease.version}'
        }],
        '@semantic-release/changelog',
        [ 
            '@semantic-release/git',
            { 
                message: 'ci(release): <%= nextRelease.version %> \n\n<%= nextRelease.notes %>'
            }
        ] 
    ]
}; 

It seems to be fine, when I make a commit of one of the types displayed in the list I can clearly see that release version is being increasing according to my definition.
But then I am looking at CHANGELOG.md file and it seems that commits are not being written and it left blanked.

image

Any idea what can cause this issue? I tried to search for a solution for this scenario few days and I feel I don't have any way to solve it by my own.

Can you tell me what is wrong with my script?

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