Code Monkey home page Code Monkey logo

auto-generate-changelog's Introduction

auto-generate-changelog

Codacy Badge GitHub release (latest by date) language-python LICENSE Apache-2.0

A Github Action to generate CHANGELOG automatically according to conventional commits.

Feel free to submit a pull request or an issue, but make sure to follow the templates.

Welcome contributors to improve this project together!

If you like this, please give me a star!

Usage

Create a workflow file such as .github/workflows/changelog.yml (you can find it in this repo)

name: Generate changelog
on:
  release:
    types: [created, edited]

jobs:
  generate-changelog:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - uses: BobAnkh/auto-generate-changelog@master
      with:
        REPO_NAME: '<YourUserName>/<YourRepoName>'
        ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
        PATH: 'CHANGELOG.md'
        COMMIT_MESSAGE: 'docs(CHANGELOG): update release notes'
        TYPE: 'feat:Feature,fix:Bug Fixes,docs:Documentation,refactor:Refactor,perf:Performance Improvements'

NOTE: Generating CHANGELOG needs all the commit history so you should set fetch-depth: 0 with actions/checkout

NOTE: commit log begins with docs(changelog) or doc(CHANGELOG) will not be added to the CHANGELOG

Inputs

Please see notes below the table for more optional features.

Inputs Description Required Default
REPO_NAME Repository name no '' which means current repository
ACCESS_TOKEN Github Access Token yes You can just pass ${{secrets.GITHUB_TOKEN}}
PATH Path to the your file no /CHANGELOG.md
BRANCH The branch to update file specified in PATH no '' which means default branch
PULL_REQUEST Open a new pull request if set to a target branch name no '' which means not open pull request by default
COMMIT_MESSAGE commit message no docs(CHANGELOG): update release notes
TYPE The type of commits you want to add to CHANGELOG no 'feat:Feature,fix:Fix'
COMMITTER The committer you want to use to update file no '' which means default committer
DEFAULT_SCOPE The default scope to hold all unscoped commits no general
SUPPRESS_UNSCOPED Whether to exclude unscoped commits no false

${{secrets.GITHUB_TOKEN}} has a rate limit smaller than Personal Access Token, so if you have much more requests(commits, prs, etc.), use PAT instead.

COMMITTER should be in the format: 'author <author.example>'

NOTE: PULL_REQUEST must be used with BRANCH together, both should be provided if you want to open a pull request

You can define the keyword detected from commit message and the corresonding word presented in the changelog in input TYPE. For example, define feat:Feature will detect commit message like feat(main): add new option and present this in changelog as part Feature

NOTE: You can use format below to avoid some lines in release description to appear in CHANGELOG:

<!-- HIDE IN CHANGELOG BEGIN -->
See CHANGELOG for more details.
<!-- HIDE IN CHANGELOG END -->

Maintainer

@BobAnkh

How to contribute

You should follow our Code of Conduct.

See CONTRIBUTING GUIDELINES for contributing conventions.

Make sure to pass all the tests before submitting your code. You can conduct pytest -ra at the root directory to run all tests.

You can use local mode when develope it on your local machine, here is the command-line help info:

usage: main.py [-h] [-m MODE] [-f FILE] [-o OUTPUT] [-t TOKEN]

optional arguments:
  -h, --help            show this help message and exit
  -m MODE, --mode MODE  choose to use local-dev mode or on github action mode.
                        Valid values are 'local' or 'github'
  -f FILE, --file FILE  configuration file to read from when running local-dev
                        mode
  -o OUTPUT, --output OUTPUT
                        output file when running local-dev mode
  -t TOKEN, --token TOKEN
                        Github Access Token

Contributors

Yixin
Yixin Shen
Sebastian
Sebastian Rühl

LICENSE

Apache-2.0 © BobAnkh

auto-generate-changelog's People

Contributors

bobankh avatar github-actions[bot] avatar dependabot[bot] avatar mergify[bot] avatar sruehl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.