Skip to content

Add changelog init command#2697

Open
lcawl wants to merge 1 commit intomainfrom
changelog-init
Open

Add changelog init command#2697
lcawl wants to merge 1 commit intomainfrom
changelog-init

Conversation

@lcawl
Copy link
Contributor

@lcawl lcawl commented Feb 14, 2026

Summary

Add a docs-builder changelog init command that scaffolds changelog configuration and directory structure for a repository.

What it does

  • Creates docs/changelog.yml from the built-in changelog.example.yml template (if it doesn't already exist)
  • Creates docs/changelog and docs/releases directories (if they don't already exist)
  • When --changelog-dir or --bundles-dir override the defaults, updates bundle.directory and bundle.output_directory in the created changelog.yml

Options

Option Default Description
--repository Current directory Repository root path
--docs {repository}/docs Docs folder path
--config {docs}/changelog.yml Changelog config file path
--changelog-dir {docs}/changelog Changelog input directory
--bundles-dir {docs}/releases Bundles output directory

Usage examples

# Initialize in current directory
docs-builder changelog init

# Initialize in a specific repository
docs-builder changelog init --repository /path/to/my-repo

# Custom paths (updates bundle.directory and bundle.output_directory in changelog.yml)
docs-builder changelog init --changelog-dir ./my-changelogs --bundles-dir ./my-bundles

Files changed

File Change
src/tooling/docs-builder/docs-builder.csproj Embed changelog.example.yml as a resource
src/tooling/docs-builder/Commands/ChangelogCommand.cs Add init subcommand, GetPathForConfig helper, update help text
docs/cli/release/changelog-init.md New command documentation
docs/cli/release/index.md Add link to changelog init
docs/_docset.yml Add changelog-init.md to table of contents
docs/contribute/changelog.md Mention changelog init in configuration section

Generative AI disclosure

  1. Did you use a generative AI (GenAI) tool to assist in creating this contribution?
  • Yes
  • No
  1. If you answered "Yes" to the previous question, please specify the tool(s) and model(s) used (e.g., Google Gemini, OpenAI ChatGPT-4, etc.).

Tool(s) and model(s) used: composer 1.5, claude-4.6-opus-high

var repoPath = NormalizePath(repository ?? ".");
var docsPath = NormalizePath(docs ?? Path.Combine(repoPath, "docs"));
var configPath = NormalizePath(config ?? Path.Combine(docsPath, "changelog.yml"));
var defaultChangelogPath = Path.Combine(docsPath, "changelog");
var docsPath = NormalizePath(docs ?? Path.Combine(repoPath, "docs"));
var configPath = NormalizePath(config ?? Path.Combine(docsPath, "changelog.yml"));
var defaultChangelogPath = Path.Combine(docsPath, "changelog");
var defaultBundlesPath = Path.Combine(docsPath, "releases");
if (stream == null)
{
// Fallback: try config relative to current directory (for development)
var localConfigPath = Path.Combine(Directory.GetCurrentDirectory(), "config", "changelog.example.yml");
)
{
var repoPath = NormalizePath(repository ?? ".");
var docsPath = NormalizePath(docs ?? Path.Combine(repoPath, "docs"));
{
var repoPath = NormalizePath(repository ?? ".");
var docsPath = NormalizePath(docs ?? Path.Combine(repoPath, "docs"));
var configPath = NormalizePath(config ?? Path.Combine(docsPath, "changelog.yml"));
@github-actions
Copy link

@lcawl lcawl marked this pull request as ready for review February 14, 2026 01:46
@lcawl lcawl requested review from a team as code owners February 14, 2026 01:46
@lcawl lcawl requested a review from cotti February 14, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant