mirror of
https://github.com/orhun/git-cliff-action.git
synced 2026-03-22 07:25:43 +08:00
feat(input): use the config file from given path
This commit is contained in:
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@@ -11,6 +11,7 @@ jobs:
|
|||||||
id: git-cliff
|
id: git-cliff
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
config: fixtures/cliff.toml
|
||||||
args: --verbose
|
args: --verbose
|
||||||
- name: Print the changelog
|
- name: Print the changelog
|
||||||
run: echo "${{ steps.git-cliff.outputs.changelog }}"
|
run: echo "${{ steps.git-cliff.outputs.changelog }}"
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ This action generates a changelog based on your Git history using [git-cliff](ht
|
|||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
* `args`: Arguments to pass to git-cliff. Default `"-v"`
|
* `config`: Path of the configuration file. Default: `"cliff.toml"`
|
||||||
|
* `args`: Arguments to pass to git-cliff. Default: `"-v"`
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
|
|
||||||
@@ -18,6 +19,7 @@ This action generates a changelog based on your Git history using [git-cliff](ht
|
|||||||
- name: Changelog Generator
|
- name: Changelog Generator
|
||||||
uses: orhun/git-cliff-action@v1
|
uses: orhun/git-cliff-action@v1
|
||||||
with:
|
with:
|
||||||
|
config: cliff.toml
|
||||||
args: --verbose
|
args: --verbose
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,22 @@
|
|||||||
name: "git-cliff: Changelog Generator"
|
name: "git-cliff: Changelog Generator"
|
||||||
description: "Generate changelog based on your Git history"
|
description: "Generate changelog based on your Git history"
|
||||||
inputs:
|
inputs:
|
||||||
|
config:
|
||||||
|
description: "config file location"
|
||||||
|
required: false
|
||||||
|
default: "cliff.toml"
|
||||||
args:
|
args:
|
||||||
description: "git-cliff arguments"
|
description: "git-cliff arguments"
|
||||||
required: false
|
required: false
|
||||||
default: "-v"
|
default: "-v"
|
||||||
outputs:
|
outputs:
|
||||||
changelog:
|
changelog:
|
||||||
description: 'generated changelog'
|
description: "generated changelog"
|
||||||
runs:
|
runs:
|
||||||
using: "docker"
|
using: "docker"
|
||||||
image: "Dockerfile"
|
image: "Dockerfile"
|
||||||
args:
|
args:
|
||||||
- ${{ inputs.args }}
|
- "-c ${{ inputs.config }} ${{ inputs.args }}"
|
||||||
branding:
|
branding:
|
||||||
icon: "triangle"
|
icon: "triangle"
|
||||||
color: "orange"
|
color: "orange"
|
||||||
|
|||||||
25
fixtures/cliff.toml
Normal file
25
fixtures/cliff.toml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# configuration file for git-cliff (0.1.0)
|
||||||
|
|
||||||
|
[changelog]
|
||||||
|
header = "# Changelog\n"
|
||||||
|
body = """
|
||||||
|
{% if version %}\
|
||||||
|
## [{{ version | replace(from="v", to="") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||||
|
{% else %}\
|
||||||
|
## [unreleased]
|
||||||
|
{% endif %}\
|
||||||
|
{% for group, commits in commits | group_by(attribute="group") %}
|
||||||
|
### {{ group | upper_first }}
|
||||||
|
{% for group, commits in commits | group_by(attribute="scope") %}\
|
||||||
|
#### {{ group }}\
|
||||||
|
{% for commit in commits %}
|
||||||
|
- {{ commit.message | upper_first }}\
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}\
|
||||||
|
{% endfor %}\n
|
||||||
|
"""
|
||||||
|
trim=true
|
||||||
|
footer = "<!-- generated by git-cliff -->\n"
|
||||||
|
|
||||||
|
[git]
|
||||||
|
conventional_commits = true
|
||||||
Reference in New Issue
Block a user