Skip to content
Merged
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
6 changes: 4 additions & 2 deletions git-cliff-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ runs:
elif [[ '${{ inputs.release_type }}' = auto ]]; then
version_number=$(git-cliff --bumped-version | sed s/^v//)

# If there are no commits that increase semver, break
if [[ "$(git describe --tags --abbrev=0)" = "v${version_number}" ]]; then
# If there are no commits that increase semver, break.
# In a repo with no tags yet there is always something to release, and
# git describe would fail with a non-zero exit - guard against that.
if latest_tag=$(git describe --tags --abbrev=0 2> /dev/null) && [[ "$latest_tag" = "v${version_number}" ]]; then
echo "::error title=Nothing to release::There were no commits that trigger a version bump since the last release"
exit 1
fi
Expand Down
3 changes: 3 additions & 0 deletions git-cliff-release/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ trim = true
postprocessors = []

[bump]
# Version used for repositories with no existing tags. The "v" prefix keeps it
# matching tag_pattern, so setting up a brand-new repo works out of the box.
initial_tag = "v0.1.0"
# With 0.x.y version, breaking commits should only increase the minor version and feature commits should only increase the patch version
breaking_always_bump_major = false
features_always_bump_minor = false
Expand Down
Loading