Skip to content

Commit c4f0d28

Browse files
authored
fix(bump): check the next version against tag_pattern regex (#1070)
1 parent eb9b6bd commit c4f0d28

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

git-cliff/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,14 @@ pub fn run_with_changelog_modifier(
722722
} else {
723723
return Ok(());
724724
};
725+
if let Some(tag_pattern) = &config.git.tag_pattern {
726+
if !tag_pattern.is_match(&next_version) {
727+
return Err(Error::ChangelogError(format!(
728+
"Next version ({}) does not match the tag pattern: {}",
729+
next_version, tag_pattern
730+
)));
731+
}
732+
}
725733
if args.bumped_version {
726734
writeln!(out, "{next_version}")?;
727735
return Ok(());

0 commit comments

Comments
 (0)