feat(changelog): skip ssh and x509 signatures in tag messages #748
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Support for tag messages was added in 3eb828e. The commit contains code for stripping GPG signatures from the tag message, but git supports SSH signatures and x509 signatures as well.
This PR adds support for stripping those signature types.
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).Motivation and Context
Signatures should not show up in the changelog, regardless of what kind of signature was used.
How Has This Been Tested?
I have no x509 certificates, but I created a SSH-signed tag in my fork, and then ran the
resolves_existing_tag_with_name_and_message
test and replaced the tag that is checked fromv0.2.3
toexample-ssh-signed-tag
Screenshots / Logs (if applicable)
Types of Changes
Arguably this could also be a bug fix.
Checklist:
I did not update any documentation, since I could find no mention of the gpg signature stripping.
I am not sure how to add a test: the existing functionality is covered by reading a tag that is GPG signed, but I have no way to add a SSH signed tag to this repository :^)