Skip to content

Commit fa54a6a

Browse files
authored
fix(fixtures): evaluate the rc of git-cliff correctly (#1104)
1 parent 77632b2 commit fa54a6a

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

.github/actions/run-fixtures-test/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ runs:
3939

4040
- name: Generate a changelog
4141
working-directory: ${{ inputs.fixtures-dir }}
42+
shell: bash
4243
run: |
43-
git cliff --config cliff.toml ${{ inputs.command }} > output.md || true
44+
set +e
45+
git cliff --config cliff.toml ${{ inputs.command }} > output.md
4446
echo "$?" > output.rc
4547
if [ -f output.md ]; then
4648
cat output.md
4749
fi
48-
shell: bash
4950
5051
- name: Compare the output with the expected output
5152
working-directory: ${{ inputs.fixtures-dir }}
@@ -67,7 +68,7 @@ runs:
6768
shell: bash
6869
run: |
6970
if [ -f expected.rc ]; then
70-
if ! diff --strip-trailing-cr output.rc expected.rc; then
71+
if ! diff --strip-trailing-cr --ignore-all-space output.rc expected.rc; then
7172
echo "The return code does not match the expected return code."
7273
exit 1
7374
fi

.github/fixtures/test-require-conventional-skipped/cliff.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ require_conventional = true
4545
# Assigns commits to groups.
4646
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
4747
commit_parsers = [
48-
{ message = "^feat", group = "Features", default_scope = "app", skip = true },
48+
{ message = "^feat", group = "Features", default_scope = "app" },
49+
{ message = "^fix", group = "Bug Fixes", skip = true },
4950
{ message = "Initial commit", skip = true },
5051
]
5152
# Prevent commits that are breaking from being excluded by commit parsers.

.github/fixtures/test-require-conventional-skipped/commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
GIT_COMMITTER_DATE="2022-04-06 01:25:08" git commit --allow-empty -m "Initial commit"
55
GIT_COMMITTER_DATE="2022-04-06 01:25:09" git commit --allow-empty -m "feat: add feature 1"
6-
GIT_COMMITTER_DATE="2022-04-06 01:25:10" git commit --allow-empty -m "fix!: fix feature 1"
6+
GIT_COMMITTER_DATE="2022-04-06 01:25:10" git commit --allow-empty -m "fix: fix feature 1"
77
GIT_COMMITTER_DATE="2022-04-06 01:25:11" git commit --allow-empty -m "feat(gui)!: add feature 2"
88
GIT_COMMITTER_DATE="2022-04-06 01:25:12" git commit --allow-empty -m "fix(gui)!: fix feature 2"
99

.github/fixtures/test-require-conventional-skipped/expected.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ All notable changes to this project will be documented in this file.
66

77
### Bug Fixes
88

9-
#### Cli
9+
#### Gui
1010

11-
- Fix feature 1
1211
- Fix feature 2
1312

1413
### Features
1514

15+
#### App
16+
17+
- Add feature 1
18+
1619
#### Gui
1720

1821
- Add feature 2

0 commit comments

Comments
 (0)