changelog-bot simplifies the creation of changelogs by transforming Git history and release notes into polished entries. With options for AI assistance, it can enhance the storytelling of releases and minimize tedious manual processes. Whether used in CI or locally, it ensures accurate and consistent outputs with minimal effort.
changelog-bot is an innovative tool designed to automatically generate changelogs using AI, streamlining the release process. This powerful CLI tool effortlessly converts Git history and release notes into well-structured changelog entries with just a single command. Ideal for integration into CI workflows, it alleviates the burden of manual documentation, ensuring a consistent and polished release presentation.
Key Features
- Automated Storytelling: Combines commits, PR titles, and release notes to create human-readable changelog sections.
- AI Capabilities: Optionally utilize AI from OpenAI or Anthropic for sophisticated, tone-aware summaries, or rely on a comprehensive heuristic method when API keys are not available.
- PR-Ready Output: Automatically opens a pull request with the updated changelog, including compare links and release notes.
- Safe Defaults: Prevents duplicate versions, maintains real-time compare links, and ensures operation even if AI services are temporarily unavailable.
- CI-Native: Operates directly as a GitHub Action, through reusable workflows, or as a standalone CLI without the need for complex scripts.
Quick Usage Examples
To get started, simply run the CLI command to display help options:
pnpm dlx @nyaomaru/changelog-bot --help
Generate a changelog for the latest tagged release:
pnpm dlx @nyaomaru/changelog-bot \
--release-tag HEAD \
--release-name 0.1.0-dev \
--changelog-path CHANGELOG.md \
--provider openai \
--dry-run
For generating changelogs without AI keys, a fallback mechanism is incorporated, ensuring smooth execution:
# Execute changelog generation without AI keys
pnpm dlx @nyaomaru/changelog-bot --release-tag HEAD --release-name 1.2.3
Integration with GitHub Actions
Integrating changelog-bot into a CI pipeline is straightforward. Below is a simple action setup to update the changelog upon a new release:
name: Update Changelog
on:
release:
types: [published]
jobs:
changelog:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: nyaomaru/changelog-bot@v0 # Specify version here
with:
changelog-path: CHANGELOG.md
base-branch: main
provider: openai
release-tag: ${{ github.event.release.tag_name }}
release-name: ${{ github.event.release.tag_name }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
The changelog-bot brings efficiency and clarity to the changelog creation process while keeping users informed and ready to adapt as the development landscape evolves.
No comments yet.
Sign in to be the first to comment.