This pre-commit hook allows semantic-release to be run from non-node projects where pre-commit is installed.
-
Create your
.releaserc
config file in the repo's root, as explained in semantic-release docs. -
Add the following to your repo's
.pre-commit-config.yaml
, adding any required plugins asadditional_dependencies
orargs
:- repo: https://github.com/joberstein/precommit-semantic-release rev: <latest tag> hooks: - id: semantic-release stages: - manual additional_dependencies: - @semantic-release/exec args: - -d - --branches=test
Install the hook in your project repo:
pre-commit install
Run the hook in your CI configuration or on the command-line as a manual hook:
pre-commit run --hook-stage manual semantic-release