-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changelog diffcheck #20
Comments
I think it would be hard to parse diffs properly. We currently don't know the line numbers of each release, only their character/rune offsets in the file. I also have no interest in implementing something like this, since I feel this does not fit in with the existing features. That being said, you could solve this problem with a combination of diff \
<(git show main:CHANGELOG.md | clparse --format=json - | jq '.releases[] | select(.version != null)') \
<(git show HEAD:CHANGELOG.md | clparse --format=json - | jq '.releases[] | select(.version != null)') This works as follows:
The exit code is 0 when the strings are the same, so for your use-case when everything is fine, and 1 if a frozen section was changed. |
Thank you so much for providing this command line magic! 🤩 |
In case someone finds this issue via Google. The proposed script works only if versions follow SemVer. |
After a release, the CHANGELOG section of that release must not be altered. In case the development workflow of a project is to manually edit the CHANGELOG, it might happen that changes come in:
I need a check at step 4 to say: "Frozen CHANGELOG.md section changed". I would implement a CLI like that:
Returns error level != 0 in case a frozen section is touched.
The text was updated successfully, but these errors were encountered: