git-bump
git-bump copied to clipboard
Trigger commit hooks when git bump is run
Coin commit hooks that can reside in ./.git/hooks/ that will be called pre and post git bump.
For the pre commit hook if you respect failures you can prevent git bump unless project specific conditions are accounted for. For example all tests must be green before bumping the version.
With the post commit hook you could then do something like publish built gem.
It may also be beneficial to support these hooks in a ./.bump directory so they could be committed and shared with the team.
Any reason this can't be handled by pre-commit and post-commit instead? We could set an environment variable or two if that helps.
I'm particularly skeptical of the post-bump example. I think requiring a separate step is a good precaution against accidental publishing.
Having the environment variable is feasible, and easy to deal with in the default commit hook paradigm.