changelog-generator

Build & Test

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.

Changelog Generator

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 }}

Inputs

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

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.

Outputs

Troubleshooting

Error not found

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.

Acknowledgements

Example

License

The scripts and documentation in this project are released under the MIT License