Post a PR comment when semver is violated
Motivations
Right now release-plz analyzes semver violations on the main branch and bumps the version accordingly. But having a semver violation committed to main might be already too late!
Solution
We want to post a PR comment when there's a semver violation. The maintainer is free to merge the PR, but they have been warned :)
Why doing this in release-plz and not in another github action? because we want to read the info of the release-plz config file. I.e. some people might want to enable/disable semver_check.
This workflow should be added to the
on:
pull_request:
in github actions.
We should add a command called "review". E.g. release-plz review <pr_link>.
Question
- Is there a convenient way to add this to the cargo-semver-check action, too?
To avoid being too spammy, we should only post the commit when semver checks detects a breaking change in the changed lines of the PRs. If a line was deleted or edited and a breaking change was detected that, then let's post the comment.
Btw we should also post the comment if semver is respected, right?
EDIT: I don't think so, reading the logs from GitHub Actions should be enough if people want to make sure that release-plz ran.
EDIT 2: having cargo-semver-checks running as a library ( https://github.com/obi1kenobi/cargo-semver-checks/issues/396 ) would be handy to implement this, so that we don't have to parse stdout.