February 28, 2023
github actions hot to generate changelog
Have an opinion? Send us proposed edits/additions and we may incorporate them into this article with credit.
Words
855
Time
1m 41s
Contributors
18
Words read
4.0k
Changelog CI
action-github-changelog-generator
mindsers/changelog-reader-action
actions/create-release
heinrichreimer/github-changelog-generator-action
All answers
Generate Changelog
Automation
Commit Messages
Generating a Custom Format
Conventional Commits 'Standard'
Jump to top
Research
Source: "Generating changelogs from git" (from reddit, r/git)
-
Iterating over commit messages and generating a custom format
- This can be done by a programmer to allow more flexibility in how commits are structured
- Commit messages should be understandable by programmers, while changelogs should be understandable by users
-
Conventional Commits “standard”
- This is a structured commit message format which allows keywords to pull out user-level information
-
conventional-changelog
- This is a tool which can be used to handle a variety of commit conventions
Source: "Changelog from Conventional Commits * Actions -..." (from web, github.com)
-
Use the Github Action “Changelog from Conventional Commits”
- Generates the CHANGELOG changes in Markdown format
- Turns PR ids into links and add the PR author
- Prepends a shortened commit SHA ID to the commit for quick access
-
Adds
BREAKING CHANGE
notes to the top of the changelog version for each related commit - Exports changelog to a variable that can used in a subsequent step to create a release changelog
- Automatically injects the changes into the CHANGELOG.md file or creates it if it doesn’t exist yet
- Will not mess up with any header or instructions you already have at the top of your CHANGELOG.md
- Will not add duplicate version changes if it already exists in the CHANGELOG.md file
-
Optionally exclude types from the CHANGELOG (default:
build,docs,other,style
)
-
Use the “Git-Auto-Commit-Action”
- Commits any changes to the CHANGELOG.md file
- Allows for a custom commit message, including “[skip ci]” if needed
Source: "Generate changelog with git-chglog * Actions - ..." (from web, github.com)
-
Create a workflow.yml file in your repositories.github/workflows directory
- Reference the GitHub Help Documentation for Creating a workflow file
- Further more you need to have git-chlog configured and have the configuration added to your git repository
-
Inputs:
-
next_version
: Next version number -
config_dir
: git-chglog configuration directory. Default:.ghglog
-
filename
: Filename to write the changelog to. Default:CHANGELOG.md
-
tag
: Optional, Generate changelog only for this tag.
-
-
Outputs:
-
changelog
: Changelog content if nofilename
input is empty
-
-
Example workflow - upload a release asset
-
On every
push
tomaster
generate a CHANGELOG.md file
-
On every
Source: "Is it worth it to auto-generate changelogs? [xp..." (from reddit, r/github)
-
Use
git log
:-
You can get a lot of information from
git log
-
You can get a lot of information from
-
Use Danger JS:
- Mentioned as a tool for automating the generation and update of changelogs
-
Human in the loop is key:
- Commit messages and PR titles are useful as a starting point but need interpretation to make useful documentation
- Process of creating the changelog depends on branching/release model
Source: "Conventional changelog generator * Actions * Gi..." (from web, github.com)
-
Automatically generate the changelog based on your commit convention for your latest tagged version with Changelog Generator
- The changelog is accessible as action output available to other actions via output
- Example usage: uses: Helmisek/conventional-changelog-generator@v1.0.6-release
- Inputs: commit-types, current-tag, template-path, tag-regex
- Outputs: changelog
-
Use your own custom template
- Copy the CHANGELOG.tpl.md into your project
- Modify it and add the file path to the action configuration
💭 Looking into
What is the best way to generate changelogs using GitHub Actions?
💭 Looking into
How can I automate the process of generating changelogs and releases in GitHub?
💭 Looking into
What features does the heinrichreimer/github-changelog-generator-action action provide?
💭 Looking into
How can the action-github-changelog-generator be used to generate changelogs?
💭 Looking into
What features does the conventional-commit-changelog action provide?
💭 Looking into
How does Changelog CI work to generate changelogs?
💭 Looking into
What types of Github Actions are available for generating changelogs?
Source: "Generate changelog * Actions * GitHub Marketpla..." (from web, github.com)
-
Use the action-github-changelog-generator
- Automatically generate change log from your tags, issues, labels and pull requests on GitHub, using github-changelog-generator’s Docker image.
- This action also makes the changelog available to other actions as output.
- Inputs include token, dateFormat, output, base, headerLabel, configureSections, addSections, frontMatter, issues, issuesWoLabels, pullRequests, prWoLabels, filterByMilestone, author, usernamesAsGithubLogins, unreleasedOnly, unreleased, unreleasedLabel, compareLink, includeLabels, excludeLabels, issueLineLabels, excludeTags, excludeTagsRegex, sinceTag, dueTag, maxIssues, releaseUrl, githubSite, githubApi, simpleList, futureRelease, releaseBranch, httpCache, cacheFile, cacheLog, sslCaFile, verbose, breakingLabel, breakingLabels, enhancementLabel, enhancementLabels, bugsLabel, bugLabels, deprecatedLabel, deprecatedLabels, removedLabel, removedLabels, securityLabel, securityLabels, issuesLabel, prLabel, onlyLastTag, stripHeaders, stripGeneratorNotice
- Outputs include changelog
Source: "Automate changelog and releases creation in GitHub" (from web, dev.to)
-
Use the
heinrichreimer/github-changelog-generator-action
Action- This action should be used as part of a CI process
-
It can handle merged PRs, issues, and commits to the
main
branch - It can group changes under an “Unreleased” section
- It can add sections for labels, such as “Documentation”
-
Use the
mindsers/changelog-reader-action
andactions/create-release
Actions- These should be used when pushing a new tag
-
The
changelog-reader-action
can be used to select the changelog entry associated with the tag -
The
create-release
action can be used to generate a GitHub Release with the content of the changelog entry -
The
create-release
action requires theGITHUB_TOKEN
for authentication
Source: "Generate Changelog (Conventional Commit) * Acti..." (from web, github.com)
-
Use actions/checkout@v2
- This allows you to fetch the git history for the changelog
-
Use seasonalmatcha/conventional-commit-changelog@latest
- This is the action that will generate the changelog from the git history
- This action requires two inputs: from and to (references or tags to mark the start and end of the changelog)
-
The output of this action can be accessed with
${{ steps.changelog.outputs.changelog }}
-
This work is inspired by https://github.com/dlavrenuek/conventional-changelog-action
- Some of the code has been reused and modified to fit the needs of the task
Source: "A GitHub Action that generates a changelog for you" (from web, changelog.com)
-
Use Changelog CI to generate a changelog via carefully crafted PR titles
- Changelog CI is not a new service offering from news feed providers
- Auto-generating your project’s changelog may be a good idea
Source: "How to generate Changelog using Conventional Co..." (from reddit, r/github)
-
Use commit messages to create a “first version” of the changelog
- This is meant to be massaged and fixed up before being the real final changelog
- This is a good way to not forget something important
-
Changelogs should be done for some projects
- This can be added to the toolbox
💭 Looking into
What is the best way to generate a changelog with GitHub Actions?