Skip to main content

Registering the services

The services required should be setup in your startup.cs by calling the AddChangelogServices method:

using cangulo.changelog.Extensions;
//...
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
//...
services.AddChangelogServices(settings);
//...
}
}

Example at cangulo.nuke.releasecreator

The object passed is a ChangelogSettings instance. It sets the working mode (Conventional or Non-Conventional Commits) in the CommitsMode attribute. In case you want to go with the conventional ones, you have to provide the types in the ConventionalCommitsSettings.

public class ChangelogSettings
{
public CommitsMode CommitsMode { get; set; }
public ConventionalCommitsSettings ConventionalCommitsSettings { get; set; }
}

public class ConventionalCommitsSettings
{
public string[] Types { get; set; }
}
public enum CommitsMode
{
NonConventionalCommits, // Yes, I also allow non conventional commits
ConventionalCommits
}

Definition at cangulo.changelog

Idea!
Define those settings in a json file, maybe your appsettings, and parse them. Click Here to check an example
{
"commitsMode": "conventionalCommits",
"conventionalCommitsSettings": {
"types": [
"fix",
"patch",
"refactor",
"feat",
"major",
"break",
"docs"
]
}
}

Example at cangulo.nuke.releasecreator


Did you like it? Share It!