Skip to content

Commit ecbabbf

Browse files
authored
feat(changelog): skip ssh and x509 signatures in tag messages (#748)
Git supports SSH and x509 signatures in addition to GPG signatures. See <https://git-scm.com/docs/gitformat-signature#_description>. The regex is not 100% accurate (e.g. this would allow `SSH MESSAGE`, which is not part of the gitformat-signature description), but I prioritized readability over correctness in this case (since the code is for replacing text, not verifying the signature).
1 parent 61a59c6 commit ecbabbf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-cliff-core/src/repo.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ use url::Url;
2525

2626
/// Regex for replacing the signature part of a tag message.
2727
static TAG_SIGNATURE_REGEX: Lazy<Regex> = lazy_regex!(
28-
r"(?s)-----BEGIN PGP SIGNATURE-----(.*?)-----END PGP SIGNATURE-----"
28+
// https://git-scm.com/docs/gitformat-signature#_description
29+
r"(?s)-----BEGIN (PGP|SSH|SIGNED) (SIGNATURE|MESSAGE)-----(.*?)-----END (PGP|SSH|SIGNED) (SIGNATURE|MESSAGE)-----"
2930
);
3031

3132
/// Wrapper for [`Repository`] type from git2.

0 commit comments

Comments
 (0)