You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Tag Changelog
0.11.0
A GitHub Action triggered by a new tag getting pushed. It then fetches all the commits since the previous tag and creates a changelog text using the Conventional Commits format. It will also turn PR numbers into clickable links.
This action returns the generated changelog text, but doesn't do anything more; you need to for example prepend it to a CHANGELOG.md
file, create a GitHub Release with this text, etc. A full example doing all these things is given below.
name: Create Release
on:
push:
tags:
- '*'
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create changelog text
id: changelog
uses: loopwerk/conventional-changelog-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
exclude: other,doc,chore
- name: Create release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changelog.outputs.changes }}
- name: Read CHANGELOG.md
id: readfile
uses: juliangruber/read-file-action@v1
with:
path: ./CHANGELOG.md
- name: Write to CHANGELOG.md
uses: DamianReeves/write-file-action@master
with:
path: ./CHANGELOG.md
contents: ${{ steps.changelog.outputs.changelog }}${{ steps.readfile.outputs.content }}
write-mode: overwrite
- name: Commit and push CHANGELOG.md
uses: EndBug/add-and-commit@v7
with:
add: CHANGELOG.md
message: "chore: Update CHANGELOG.md"
branch: main
token
: Your GitHub token,${{ secrets.GITHUB_TOKEN }}
. Required.exclude
: A comma separated list of commits types you want to exclude from the changelog. Optional.
changelog
: Generated changelog for the latest tag.changes
: Generated changelog for the latest tag, without the version/date header.
This action is very simple, and not very configurable yet.
- It would be nice to be able to supply a changelog message template instead of having a hardcoded template in the action itself.
- The mapping from raw type (like
feat
) to changelog header (likeNew Features
) would also be good to have configurable. - Mentioning the author of a PR within the changelog would be good.
- Display breaking changes notes.
Thanks to Helmisek/conventional-changelog-generator and ardalanamini/auto-changelog for inspiration. Thanks to nektos/act for making it possible to run GitHub Actions locally, making development and testing a whole lot easier.