Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/fixtures/test-workdir-include-path/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[changelog]
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""

[git]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features", default_scope = "app" },
{ message = "^fix", group = "Bug Fixes", scope = "cli" },
]
8 changes: 8 additions & 0 deletions .github/fixtures/test-workdir-include-path/commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e

git remote add origin https://github.com/orhun/git-cliff
git fetch
mv cliff.toml cliff.toml.bak
git checkout 076feb74b4d8c8634669f57d4e2765c39490d80e
mv cliff.toml.bak .github/fixtures/cliff.toml
13 changes: 13 additions & 0 deletions .github/fixtures/test-workdir-include-path/expected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## [unreleased]

### Bug Fixes

- Include the root commit when `--latest` is used with one tag (#901)
- Match PR and release metadata correctly (#907)
- Fix missing commit fields in context (#837) (#920)
- Preserve first time contributors (#925)

### Features

- Allow overriding the remote API URL via config (#896)

2 changes: 2 additions & 0 deletions .github/workflows/test-fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ jobs:
- fixtures-name: test-regex-json-array
- fixtures-name: test-release-statistics
previous-release-timestamp: "2022-04-06 01:25:12"
- fixtures-name: test-workdir-include-path
command: v2.6.1..v2.7.0 --workdir .github/fixtures/

steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions git-cliff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ pub fn run_with_changelog_modifier(
if let Some(changelog) = args.prepend {
args.prepend = Some(workdir.join(changelog));
}
args.include_path = Some(vec![Pattern::new(workdir.to_string_lossy().as_ref())?])
}

// Set path for the configuration file.
Expand Down
Loading