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
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 from
changelog
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.
The scripts and documentation in this project are released under the MIT License