feat: Add commit-types & default-commit-type inputs (#15)

* deps: Add `yaml` version `1.10.2`

* deps: Add `joi` version `17.6.0`

* feat: Add `commit-types` & `default-commit-type` inputs

* ci: Update `Test` workflow

* chore: Update `README.md`
This commit is contained in:
Ardalan Amini authored and GitHub committed 2022-03-04 14:17:53 +03:30
1 parent c72a270e90
commit ea01804ccf
12 files changed
+374 -77

No files matched your search

+73 -25
View File
@@ -12,42 +12,66 @@ To use this action, your commit messages have to follow the format below:
type(category): description [flag]
```
The `type` must be one of the followings:
* The `type` must be one of `commit-types` input keys. In the changelog output, the value will be used.
* `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)
> The changelogs will be in the same order as `commit-types` input.
> The changelogs will be in the same order as listed above.
> If the `type` doesn't match any of the provided `commit-types` input keys, The `default-commit-type` input will be used instead.
> If the `type` is not found in the list, it'll be considered as `other`.
* The `category` is optional and can be anything of your choice.
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:
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)
* `ignore` (Omits the commit from the changelog)
> If `flag` is not found in the list, it'll be ignored.
> If `flag` is not found in the list, it'll be ignored.
### Inputs
#### `token` **(Required)**
#### `token` **(Optional)**
Github token.
_Default:_ `${{ github.token }}`
_Default:_
```yaml
${{ github.token }}
```
#### `commit-types` **(Optional)**
Commit type.
_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
```
### Outputs
@@ -57,8 +81,32 @@ The generated changelog.
### Example usage
Using default inputs:
```yaml
uses: ardalanamini/auto-changelog@v1
```
Using custom inputs:
```yaml
uses: ardalanamini/auto-changelog@v1
with:
exclude: 'perf,other,breaking'
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
```