Skip to content

jaywcjlove/changelog-generator

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Changelog Generator

Buy me a coffee Build & Test Repo Dependents Coverage Status

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.

- run: echo "previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_ENV
- name: Generate changelog
  id: changelog
  uses: jaywcjlove/changelog-generator@main
  if: env.previous_tag
  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 == 'true'
  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

Define the log display template (#111).

- name: Generate changelog
  uses: jaywcjlove/changelog-generator@main
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    filter-author: (jaywcjlove|ε°εΌŸθ°ƒθ°ƒβ„’|dependabot|renovate\\[bot\\]|dependabot\\[bot\\])
    filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
    template: |
      ## Bugs
      {{fix}}
      ## Feature
      {{feat}}
      ## Improve
      {{refactor,perf,clean}}
      ## Misc 
      {{chore,style,ci||πŸ”Ά Nothing change}}
      ## Unknown
      {{__unknown__}}

Customize type and emoji icons

- name: Generate Changelog(custom-emoji test)
  uses: jaywcjlove/changelog-generator@main
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    filter-author: (ε°εΌŸθ°ƒθ°ƒβ„’|Renovate Bot)
    filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
    custom-emoji: 'type🐝,featπŸ’„,fixπŸ†Ž'

GETTING STARTED

Only use the following Git Commit Messages. A simple and small footprint is critical here.

  1. 🌟 feat Use when you add something entirely new. E.g: feat(Button): add type props.
  2. 🐞 fix Use when you fix a bug β€” need I say more? E.g. fix: Case conversion.
  3. πŸ“– doc/docs Use when you add documentation like README.md, or even inline docs. E.g. doc(Color): API Interface.
  4. πŸ’„ chore Changes to the build process or auxiliary tools. E.g. chore(Color): API Interface.
  5. 🎨 style Format (changes that do not affect code execution). E.g. style(Alert): API Interface.
  6. πŸ†Ž type Typescript type bug fixes. E.g. type(Alert): fix type error.
  7. β›‘ test Add and modify test cases. E.g. test(Alert): Add test case.
  8. 🐝 refactor Refactoring (i.e. code changes that are not new additions or bug fixes). E.g. refactor(Alert): API Interface.
  9. 🌍 website Documentation website changes. E.g. website(Alert): Add example.
  10. πŸ”™ revert Revert last commit. E.g. revert: Add test case.
  11. πŸ’Š clean clean up. E.g. clean: remove comment code.
  12. πŸ“ˆ perf Change the code to improve performance. E.g. perf(pencil): remove graphiteWidth option
  13. πŸ’’ ci Continuous integration related file modification. E.g. ci: Update workflows config.
  14. 🧯 build Changes that affect the build system or external dependencies (example scopes: gulp, webpack, vite, npm)
<type>(<scope>): <short summary>
  β”‚     β”‚         β”‚
  β”‚     β”‚         └─⫸ Summary in present tense. Not capitalized. No period at the end.
  β”‚     β”‚
  β”‚     └─⫸ Commit Scope: 
  β”‚            animations|bazel|benchpress|common|compiler|compiler-cli|core|
  β”‚            elements|forms|http|language-service|localize|platform-browser|
  β”‚            platform-browser-dynamic|platform-server|router|service-worker|
  β”‚            upgrade|zone.js|packaging|changelog|docs-infra|migrations|ngcc|ve|
  β”‚            devtools....
  β”‚
  └─⫸ Commit Type: build|ci|doc|docs|feat|fix|perf|refactor|test
                    website|chore|style|type|revert
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

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. 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
  • order Default asc, Should the log results be displayed in descending (desc) or ascending (asc) order
  • path Only commits containing this file path will be returned.
  • template Define the log display template (#111).
  • show-emoji Show emoji icons. Default true.
  • custom-emoji Customize type and emoji icons. Example typeπŸ†Ž,choreπŸ’„,fix🐞.

Outputs

  • 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

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.

You can also set env.previous_tag to "" or the previous tag if it exists, and run the step conditionally. If there is no previous tag, the step will not run:

+- run: echo "previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_ENV
 - name: Generate changelog
   id: changelog
   uses: jaywcjlove/changelog-generator@main
+  if: env.previous_tag
   with:
    token: ${{ secrets.GITHUB_TOKEN }}

See also

Acknowledgements

Example

Contributors

As always, thanks to our amazing contributors!

Made with action-contributors.

License

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

About

A GitHub Action that compares the commit differences between two branches

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy