name: "Release Changelog"
on:
push:
tags:
- "v*"
jobs:
build-changelog:
name: "Build Changelog"
runs-on: ubuntu-latest
steps:
- name: "Checkout Code"
uses: actions/checkout@v4
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
fromTag: "v1.0.0"
toTag: "v1.1.0"
release-changelog-builder
Build release notes and changelogs exactly the way you want.
What is Release Changelog Builder GitHub Action?β
The Release Changelog Builder GitHub Action automates the process of generating detailed release notes and changelogs based on pull requests (PRs) or commits. It allows flexible configurations to suit your project's needs, whether you want to categorize PRs or include custom labels.
How to Provide Configuration via JSONβ
You can provide the actionβs configuration directly in your YAML file by specifying it as configurationJson. This allows you to fine-tune changelog behavior, such as defining categories and rules for PRs.
with:
configurationJson: |
{
"categories": [
{
"title": "## π Features",
"labels": ["feature"]
},
{
"title": "## π Fixes",
"labels": ["fix"]
}
]
}
How to Specify Configuration Fileβ
If you prefer storing configurations in a separate JSON file, you can specify its relative path with configuration. This approach helps in managing complex settings for generating changelogs.
with:
configuration: "path/to/configuration.json"
How to Set the Output File Pathβ
The outputFile input specifies the file path where the generated changelog will be stored. This is optional but useful if you want to save the changelog locally.
with:
outputFile: "changelog.md"
How to Define Repository Ownerβ
The owner input sets the owner of the repository for which the changelog is being generated. Itβs useful when dealing with multiple repositories under different owners.
with:
owner: "mikepenz"
How to Set the Repository Nameβ
The repo input defines the name of the repository you want to generate the changelog for. Itβs a required field when generating changelogs across different repositories.
with:
repo: "release-changelog-builder-action"
How to Specify Tags for Changelogβ
The fromTag and toTag inputs define the range of commits or PRs to consider when building the changelog. These tags represent the start and end points for the changelog generation.
with:
fromTag: "v1.0.0"
toTag: "v1.1.0"
How to Include Open PRsβ
The includeOpen input allows you to include currently open pull requests in the changelog. This is useful for tracking pending changes.
with:
includeOpen: true
How to Ignore Pre-releasesβ
Set ignorePreReleases to true to exclude pre-releases from changelog generation. This is particularly useful when focusing on stable releases.
with:
ignorePreReleases: true
How to Fetch PRs via Commitsβ
The fetchViaCommits input allows fetching PRs based on commits between fromTag and toTag. This is especially useful for repositories that use squash merges.
with:
fetchViaCommits: true
How to Fetch Reviewersβ
The fetchReviewers input enables the fetching of reviewers who approved each PR, adding more context to your changelog.
with:
fetchReviewers: true
How to Use Commit Modeβ
If your project does not use pull requests, you can enable COMMIT mode to generate changelogs based on commit messages. This mode treats commits like PRs but has limited access to PR-related data.
with:
mode: "COMMIT"
Outputsβ
Once the changelog is built, you can access several output variables from the action for further use in subsequent steps.
- outputs.changelog: The built release changelog.
- outputs.fromTag: The starting tag for the changelog.
- outputs.toTag: The ending tag for the changelog.
- outputs.commits: The number of commits included in the release.
Example of using the changelog output in a later step:
steps:
- name: "Use Changelog"
run: echo "${{ steps.build_changelog.outputs.changelog }}"




