Very often me and my team forget to update the package.json version of our services when pushing new code.
I would like to know if there is an automatic way to check if the current target branch's version is <= than the one in the PR's code, and if so, block the PR until it is >.
Example:
develop branch -> package.json version = 1.17.3
fix-error branch -> package.json version = 1.17.3
Expected: block the PR, because the target (develop) is in the same version of as the PR (fix-error).
Example 2:
develop branch -> package.json version = 1.17.3
fix-error branch -> package.json version = 1.17.4
Expected: allow the PR, because the target (develop) is in a lower version than the PR (fix-error), implying that the version was updated.
It would be very beneficial if the automation happens on a GitHub level, so it’s a common thing for all contributors, instead of a commit hook for example, where each person would have to implement on their own machine.
Does anyone know an easy way to do it? Thanks!