This Action returns a markdown formatted changelog between two git references. There are other projects that use milestones, labeled PRs, etc. Those are just to much work for simple projects.
I just wanted a simple way to populate the body of a GitHub Release.
- name: Generate changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
filter-author: (jaywcjlove|ε°εΌθ°θ°β’|dependabot|renovate\\[bot\\]|dependabot\\[bot\\]|Renovate Bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
Then you can to use the resulting changelog.
- name: Get the changelog
run: echo "${{ steps.changelog.outputs.changelog }}"
- name: Create Release
uses: ncipollo/release-action@v1
if: steps.create_tag.outputs.successful
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.create_tag.outputs.version }}
tag: ${{ steps.create_tag.outputs.version }}
body: |
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
Document Website: https://raw.githack.com/jaywcjlove/changelog-generator/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
Only use the following Git Commit Messages. A simple and small footprint is critical here.
feat
Use when you add something entirely new. E.g: feat(Button): add type props.
fix
Use when you fix a bug β need I say more? E.g. fix: Case conversion.
doc
Use when you add documentation like README.md, or even inline docs. E.g. doc(Color): API Interface.
chore
Changes to the build process or auxiliary tools. E.g. chore(Color): API Interface.
style
Format (changes that do not affect code execution). E.g. style(Alert): API Interface.
type
Typescript type bug fixes. E.g. type(Alert): fix type error.
test
Add and modify test cases. E.g. test(Alert): Add test case.
refactor
Refactoring (i.e. code changes that are not new additions or bug fixes). E.g. refactor(Alert): API Interface.
website
Documentation website changes. E.g. website(Alert): Add example.
revert
Revert last commit. E.g. revert: Add test case.
clean
clean up. E.g. clean: remove comment code.
perf
Change the code to improve performance. E.g. revert: Add test case.
ci
Continuous integration related file modification. E.g. ci: Update workflows config.
token
A GITHUB_TOKEN with the ability to pull from the repo in question. This is required. Why do we need token
? Read more here: About the GITHUB_TOKEN secret. Default: ${{ github.token }}
filter-author
Regular expression filtering author. Example: filter-author: (jaywcjlove|ε°εΌθ°θ°β’|dependabot\[bot\]|Renovate Bot)
filter
Regular expression filtering changelog. Example: filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
head-ref
The name of the head reference. Default ${{github.sha}}
.base-ref
The name of the second branch. Defaults to the tag_name
of the latest GitHub release. This must be a GitHub release. Git tags or branches will not work.original-markdown
Default true
, Output clean markdown content.gh-pages
Default gh-pages
, Specify the branch name to get the hash fromchangelog
Markdown formatted changelog.compareurl
Comparing two branches to see whatβs changed or to start a new pull request.tag
Tag name v1.0.0
.version
The version number of the tag created. example: 1.0.0
branch
Branch name.gh-pages-hash
Output to the latest hash of the specified branch. example: cc088c571f86fe222ff68f565
gh-pages-short-hash
Specify the branch name to get the short-hash from. example: cc088c5
Error: Not Found
If you are seeing this error its likely that you do not yet have a GitHub release. You might have a git tag and that shows up in the release tab. The API this Action uses only works with GitHub Releases. Convert one of your tags to a release and you'll be on your way. You can check out how this repository uses this action and GitHub releases for an example.
As always, thanks to our amazing contributors!
Made with action-contributors.
The scripts and documentation in this project are released under the MIT License