Skip to content

:octocat: A simple Github Action to generate changelog automatically 📝

License

Notifications You must be signed in to change notification settings

dittrichlucas/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

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

changelog generator logo

Changelog Generator

A simple Github Action to generate changelog automatically

🤔 Why?

When analyzing some market actions, none of them proposed to generate the incremental changelog and according to the standard established by keepachangelog.

Some, like github-changelog-generator, become unfeasible in the medium and long term by always regenerating the changelog file with each new release, because, from a performance point of view, the more releases/versions of the product there are, the more time-consuming it will be to generate the changelog automatically.

Thus, this action appears to facilitate changelog generation, since it searches, formats, and adds information only from the new release and not from all.

⚙️ Usage

👉 Basic

Here the release/version changelog will only be generated and the file will be checked with the cat command.

name: Changelog generator
on:
  workflow_dispatch:

jobs:
  generate-changelog:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Changelog generator
      uses: dittrichlucas/changelog-generator@main
      with:
        token: ${{ github.token }}
        repo: ${{ github.repository }}

    - name: Check changelog file
      run: cat CHANGELOG.md

👉 Advanced

In this other example, the file will be generated and a PR will be opened to the repository with the changes made.

name: Changelog generator
on:
  workflow_dispatch:

jobs:
  generate-changelog:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Changelog generator
      uses: dittrichlucas/changelog-generator@main
      with:
        token: ${{ github.token }}
        repo: ${{ github.repository }}

    - name: Create Pull Request
      id: cpr
      uses: peter-evans/create-pull-request@v3
      with:
        token: ${{ github.token}}
        commit-message: "project/ci: update the changelog file with new release deliveries"
        committer: GitHub <noreply@github.com>
        author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
        signoff: true
        branch: release-branch
        delete-branch: true
        title: "project/ci: generate the changelog file for the new release"
        body: |
          Update the `CHANGELOG.md` file with the deliveries of the new release
        draft: false

    - name: Check outputs
      run: |
        echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
        echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

Note: Here I am using (and I suggest) the create-pull-request action because it is very complete and fulfills the purpose I was looking for to open a PR with the updated changelog, but feel free to use the one that is most convenient for your case.

📝 Options

All inputs are required.

Input Description Default
token Personal access token (PAT) used to fetch the repository. Not yet
repo Repository name with owner. For example, owner/repo-name. Not yet

👣 Next Steps

Check out the roadmap

📚 References

I decided to list the articles that served as a basis for me to develop this action in Golang, if it is of interest.

📜 License

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

About

:octocat: A simple Github Action to generate changelog automatically 📝

Resources

License

Stars

Watchers

Forks

Packages

No packages published