Skip to content

Commit

Permalink
test(fixture): add test fixture for bumping version
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Dec 3, 2023
1 parent d65aec9 commit c94cb6a
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/fixtures/test-bump-version/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[changelog]
# changelog header
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") }}]
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""
9 changes: 9 additions & 0 deletions .github/fixtures/test-bump-version/commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e

GIT_COMMITTER_DATE="2021-01-23 01:23:45" git commit --allow-empty -m "feat: add feature 1"
GIT_COMMITTER_DATE="2021-01-23 01:23:45" git commit --allow-empty -m "feat: add feature 2"
git tag v0.1.0

GIT_COMMITTER_DATE="2021-01-23 01:23:46" git commit --allow-empty -m "fix: fix feature 1"
GIT_COMMITTER_DATE="2021-01-23 01:23:46" git commit --allow-empty -m "fix: fix feature 2"
19 changes: 19 additions & 0 deletions .github/fixtures/test-bump-version/expected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

All notable changes to this project will be documented in this file.

## [0.1.1]

### Fix

- Fix feature 1
- Fix feature 2

## [0.1.0]

### Feat

- Add feature 1
- Add feature 2

<!-- generated by git-cliff -->
2 changes: 2 additions & 0 deletions .github/workflows/test-fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
- fixtures-name: test-skip-breaking-changes
- fixtures-name: test-split-commits
- fixtures-name: test-keep-a-changelog-links
- fixtures-name: test-bump-version
command: --bump
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit c94cb6a

Please sign in to comment.