4 releases (breaking)
0.4.0 | May 22, 2020 |
---|---|
0.3.0 | May 19, 2020 |
0.2.0 | May 17, 2020 |
0.1.1 | May 16, 2020 |
#46 in #conventional-commits
98KB
2.5K
SLoC
ccclog
Generate changelog from commit messages created by Conventional Commits.
Sample
Getting Started
- Create a changelog from the latest tags in the working directory
❯❯ ccclog
## [0.0.0] - 2020-05-16
### Feat
- [[6274215]] add essential feature (Wataru Matsui)
- [[e4cff17]] add init (Wataru Matsui)
[6274215]: https://github.com/watawuwu/ccclog/commit/62742151681860a5f9513510015035a8c0f6fdba
[e4cff17]: https://github.com/watawuwu/ccclog/commit/e4cff17b4c8b7103cea4e36eb34dd539937af4ba
- Other usage
USAGE:
ccclog [FLAGS] [OPTIONS] [--] [ARGS]
FLAGS:
-e, --enable-email-link Make a link to the author using git config.email
-h, --help Prints help information
-r, --reverse Reverse commit display order
-V, --version Prints version information
OPTIONS:
-s, --ignore-summary <ignore-summary>
Ignore summary use regex. Syntax: https://docs.rs/regex/1.3.7/regex/#syntax
-t, --ignore-types <ignore-types>...
Ignore commit type. ex) feat|fix|build|doc|chore|ci|style|refactor|perf|test
-i, --root-indent-level <root-indent-level> Change markdown root subject indent [default: 2]
-p, --tag-prefix <tag-prefix> If there are multiple tag formats, specify the target prefix
ARGS:
<REPO_PATH> Working directory of git [default: .]
<REVISION_SPEC> Revision spec. Ref to https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
Usage from Github Action
Inputs
repo_path
Working directory of git.
revision_spec
Revision spec. Ref to https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
options
ccclog command option. Options that can be specified on the command line can be specified as they are (multiple options allowed).
ex) --reverse --tag-prefix=prefix-v
Outputs
changelog
Generated changelog
Example usage
name: Github Action Sample
on:
push:
tags:
- '*.*.*'
jobs:
create_github_release:
name: Create Github release
# If you use actions, use the platform that docker works
runs-on: ubuntu-latest
steps:
- name: Setup code
uses: actions/checkout@v2
with:
# Set the required number to create a changelog.
# If the history is small, it is recommended to specify 0 and acquire all history.
fetch-depth: 0
- name: Fetch all tags
# Get the tags to create history
# `actions/checkout@v2` has the --not-tags option
run: git fetch origin +refs/tags/*:refs/tags/*
- name: Create Changelog
id: create_changelog
uses: watawuwu/ccclog@gha-v0
# with:
# repo_path: "."
# revision_spec: "..HEAD"
# options: '--root-indent-level=3 --tag-prefix=component-v --ignore-summary=cargo\srelease.+'
# You can also exec the binary
# - name: Create Changelog
# id: create_changelog
# shell: bash -x {0}
# run: |
# mkdir bin && curl --tlsv1.2 -sSf https://raw.githubusercontent.com/watawuwu/ccclog/master/install.sh | sh -s -- --prefix ./
# changelog="$(bin/ccclog)"
# changelog="${changelog//$'\n'/'%0A'}"
# echo "::set-output name=changelog::$changelog"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
# outputs.changelog parameter is available
body: ${{ steps.create_changelog.outputs.changelog }}
Installing
- Install binary directly
❯❯ curl --tlsv1.2 -sSf https://raw.githubusercontent.com/watawuwu/ccclog/master/install.sh | sh
- Compile and install
❯❯ git clone https://github.com/watawuwu/ccclog.git && cd ccclog
❯❯ make install
- Install with cargo
❯❯ cargo install ccclog
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Authors
- Wataru Matsui
Dependencies
~17–27MB
~458K SLoC