From e85888f5d8dbd4db0674613c4c354416a9be84d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Mon, 9 Dec 2024 20:36:29 +0300 Subject: [PATCH] test(fixture): add fixture for include-path --- .../test-monorepo-include-path/cliff.toml | 34 +++++++++++++++++++ .../test-monorepo-include-path/commit.sh | 8 +++++ .../test-monorepo-include-path/expected.md | 18 ++++++++++ .github/workflows/test-fixtures.yml | 2 ++ 4 files changed, 62 insertions(+) create mode 100644 .github/fixtures/test-monorepo-include-path/cliff.toml create mode 100755 .github/fixtures/test-monorepo-include-path/commit.sh create mode 100644 .github/fixtures/test-monorepo-include-path/expected.md diff --git a/.github/fixtures/test-monorepo-include-path/cliff.toml b/.github/fixtures/test-monorepo-include-path/cliff.toml new file mode 100644 index 0000000000..b26308cde6 --- /dev/null +++ b/.github/fixtures/test-monorepo-include-path/cliff.toml @@ -0,0 +1,34 @@ +[changelog] +# template for the changelog footer +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" +# 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 +""" +# template for the changelog footer +footer = """ + +""" +# remove the leading and trailing whitespace from the templates +trim = true + +[git] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat", group = "Features", default_scope = "app" }, + { message = "^fix", group = "Bug Fixes", scope = "cli" }, +] diff --git a/.github/fixtures/test-monorepo-include-path/commit.sh b/.github/fixtures/test-monorepo-include-path/commit.sh new file mode 100755 index 0000000000..641a2f761e --- /dev/null +++ b/.github/fixtures/test-monorepo-include-path/commit.sh @@ -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 cliff.toml diff --git a/.github/fixtures/test-monorepo-include-path/expected.md b/.github/fixtures/test-monorepo-include-path/expected.md new file mode 100644 index 0000000000..3f7e907445 --- /dev/null +++ b/.github/fixtures/test-monorepo-include-path/expected.md @@ -0,0 +1,18 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [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) + + diff --git a/.github/workflows/test-fixtures.yml b/.github/workflows/test-fixtures.yml index 2ad7a95257..9df1326e80 100644 --- a/.github/workflows/test-fixtures.yml +++ b/.github/workflows/test-fixtures.yml @@ -104,6 +104,8 @@ jobs: command: --tag v0.2.0 - fixtures-name: test-custom-remote-api-url command: v1.4.0..v1.4.1 + - fixtures-name: test-monorepo-include-path + command: v2.6.1..v2.7.0 --include-path .github/fixtures/ steps: - name: Checkout