mirror of
https://github.com/darksaid98/auto-changelog.git
synced 2026-12-02 22:16:06 +00:00
* feat: Add mention-new-contributors input * deps: Add marked version 4.0.14 * feat: Include new contributors in the changelog * revert: Test workflow changes
208 lines
4.2 KiB
Markdown
208 lines
4.2 KiB
Markdown
# Auto Changelog
|
|
|
|
[](https://github.com/ardalanamini/auto-changelog/actions/workflows/test.yml)
|
|
|
|
Automatic Changelog generator
|
|
|
|
## Table of Content
|
|
|
|
- [Usage](#usage)
|
|
- [Inputs](#inputs)
|
|
- [Github Token](#github-token)
|
|
- [Commit Types](#commit-types)
|
|
- [Default Commit Type](#default-commit-type)
|
|
- [Release Name](#release-name)
|
|
- [Mention New Contributors](#mention-new-contributors)
|
|
- [Include GitHub Compare](#include-compare)
|
|
- [SemVer Compatibility](#semver)
|
|
- [Outputs](#outputs)
|
|
- [Changelog](#changelog)
|
|
- [Pre-release](#prerelease)
|
|
- [Example Usage](#example-usage)
|
|
|
|
## Usage
|
|
|
|
To use this action, your commit messages have to follow the format below:
|
|
|
|
```git
|
|
type(category): description [flag]
|
|
```
|
|
|
|
- The `type` must be one of `commit-types` input keys. In the changelog output, the value will be used.
|
|
|
|
> The changelogs will be in the same order as `commit-types` input.
|
|
|
|
> If the `type` doesn't match any of the provided `commit-types` input keys, The `default-commit-type` input will be used instead.
|
|
|
|
- The `category` is optional and can be anything of your choice.
|
|
|
|
- The `flag` is optional (if provided, it must be surrounded in square brackets) and can be one of the followings:
|
|
|
|
- `ignore` (Omits the commit from the changelog)
|
|
|
|
> If `flag` is not found in the list, it'll be ignored.
|
|
|
|
> Commit messages not matching the format mentioned above will be ignored in the `changelog` output.
|
|
|
|
### Inputs
|
|
|
|
#### `github-token`
|
|
|
|
**(Optional)**
|
|
|
|
Github token.
|
|
|
|
_Default:_
|
|
|
|
```yaml
|
|
${{ github.token }}
|
|
```
|
|
|
|
#### `commit-types`
|
|
|
|
**(Optional)**
|
|
|
|
Commit types.
|
|
|
|
_Default:_
|
|
|
|
```yaml
|
|
breaking: Breaking Changes
|
|
feat: New Features
|
|
fix: Bug Fixes
|
|
revert: Reverts
|
|
perf: Performance Improvements
|
|
refactor: Refactors
|
|
deps: Dependencies
|
|
docs: Documentation Changes
|
|
style: Code Style Changes
|
|
build: Build System
|
|
ci: Continuous Integration
|
|
test: Tests
|
|
chore: Chores
|
|
other: Other Changes
|
|
```
|
|
|
|
#### `default-commit-type`
|
|
|
|
**(Optional)**
|
|
|
|
Default commit type.
|
|
|
|
This input will be used when the commit message matches none of the defined `commit-types` input.
|
|
|
|
_Default:_
|
|
|
|
```yaml
|
|
Other Changes
|
|
```
|
|
|
|
#### `release-name`
|
|
|
|
**(Optional)**
|
|
|
|
Release name (version, e.g. `v1.0.0`).
|
|
|
|
_Default:_
|
|
|
|
```yaml
|
|
${{ github.ref_name }}
|
|
```
|
|
|
|
#### `mention-new-contributors`
|
|
|
|
**(Optional)**
|
|
|
|
Mention new contributors at the bottom of the changelog (New Contributors).
|
|
|
|
_Default:_
|
|
|
|
```yaml
|
|
true
|
|
```
|
|
|
|
#### `include-compare`
|
|
|
|
**(Optional)**
|
|
|
|
Include GitHub compare at the bottom of the changelog (Full Changelog).
|
|
|
|
> If there is no previous tag determined it'll be ommited regardless of the provided value.
|
|
|
|
_Default:_
|
|
|
|
```yaml
|
|
true
|
|
```
|
|
|
|
#### `semver`
|
|
|
|
**(Optional)**
|
|
|
|
Enable semver based version comparison.
|
|
|
|
If enabled it'll determine whether the github ref is a valid semver string,
|
|
it'll fail the action in case it's not.
|
|
|
|
It'll then determine whether the version is a pre-release or not,
|
|
if it is, the previous version will be selected from any version (pre-release or not) lesser than the current ref,
|
|
if current ref is not a pre-release,
|
|
the previous version will be selected only from the latest version (not pre-release) lesser than the current ref.
|
|
|
|
_Default:_
|
|
|
|
```yaml
|
|
true
|
|
```
|
|
|
|
### Outputs
|
|
|
|
#### `changelog`
|
|
|
|
The generated changelog.
|
|
|
|
#### `prerelease`
|
|
|
|
Indicates whether it's a pre-release or not.
|
|
|
|
> if semver is set to `true`, otherwise this output will always return `false`.
|
|
|
|
### Example Usage
|
|
|
|
Using with default inputs:
|
|
|
|
```yaml
|
|
- name: Changelog
|
|
uses: ardalanamini/auto-changelog@v3
|
|
id: changelog
|
|
```
|
|
|
|
Using with custom inputs:
|
|
|
|
```yaml
|
|
- name: Changelog
|
|
uses: ardalanamini/auto-changelog@v3
|
|
id: changelog
|
|
with:
|
|
github-token: ${{ github.token }}
|
|
commit-types: |
|
|
breaking: Breaking Changes
|
|
feat: New Features
|
|
fix: Bug Fixes
|
|
revert: Reverts
|
|
perf: Performance Improvements
|
|
refactor: Refactors
|
|
deps: Dependencies
|
|
docs: Documentation Changes
|
|
style: Code Style Changes
|
|
build: Build System
|
|
ci: Continuous Integration
|
|
test: Tests
|
|
chore: Chores
|
|
other: Other Changes
|
|
default-commit-type: Other Changes
|
|
release-name: v1.0.0
|
|
include-compare: true
|
|
semver: true
|
|
```
|