Automatic semantic version bumps for a git repository based on tags and conventional commits
8.4K
A Node.js executable package determining semantic version bumps based on the conventional commits spec.
See also version-bumper-action GitHub action.
2.1.5 2.1.6-dev{"current":"2.1.4","bump":"patch","next":"2.1.5","dev":"2.1.6-dev"}# old v2 run command
docker run --rm -v $PWD:/usr/share/repo tomerfi/version-bumper:latest --repopath /path/to/git --bumpoverride major
# new v3 run command
docker run --rm -v $PWD:/repo tomerfi/version-bumper:latest --repo /path/to/git --bump major
The version-bumper tool is executed using npx or consumed as a standard package.
We also push a container image encapsulating the executable package to docker hub.
The following examples assume:
$ npx @tomerfi/version-bumper@latest
$ docker run --rm -v $PWD:/repo tomerfi/version-bumper:latest
$ podman run --privileged --rm -v $PWD:/repo:ro docker.io/tomerfi/version-bumper:latest
For commits with a fix type, the output of the above commands will be:
{"current":"2.1.4","bump":"patch","next":"2.1.5","dev":"2.1.6-dev"}
For commits with a feat type, the output of the above commands will be:
{"current":"2.1.4","bump":"minor","next":"2.2.0","dev":"2.2.1-dev"}
For commits containing the text BREAKING CHANGE in their body, the output of the above commands will be:
{"current":"2.1.4","bump":"major","next":"3.0.0","dev":"3.0.1-dev"}
Occasionally, we may want to use this only for bumps; no git repository is required.
$ npx @tomerfi/version-bumper@latest -s 2.1.4 -b patch
$ docker run --rm tomerfi/version-bumper:latest -s 2.1.4 -b patch
{"current":"2.1.4","bump":"patch","next":"2.1.5","dev":"2.1.6-dev"}
$ npx @tomerfi/version-bumper@latest -s 2.1.4 -b minor
$ docker run --rm tomerfi/version-bumper:latest -s 2.1.4 -b minor
{"current":"2.1.4","bump":"minor","next":"2.2.0","dev":"2.2.1-dev"}
$ npx @tomerfi/version-bumper@latest -s 2.1.4 -b major
$ docker run --rm tomerfi/version-bumper:latest -s 2.1.4 -b major
{"current":"2.1.4","bump":"major","next":"3.0.0","dev":"3.0.1-dev"}
import { bumper } from '@tomerfi/version-bumper'
// prints { current: '2.1.4', bump: 'patch', next: '2.1.5', dev: '2.1.5-dev' }
bumper({source: "2.1.4", bump: 'patch'}).then(bump => console.log(bump))
// prints { current: '2.1.4', bump: 'minor', next: '2.2.0', dev: '2.2.1-dev' }
bumper({source: "2.1.4", bump: 'minor'}).then(bump => console.log(bump))
// prints { current: '2.1.4', bump: 'major', next: '3.0.0', dev: '3.0.1-alpha1' }
bumper({source: "2.1.4", bump: 'minor', label: '-alpha1'}).then(bump => console.log(bump))
Content type
Image
Digest
sha256:8d7d16474…
Size
112.5 MB
Last updated
about 1 month ago
docker pull tomerfi/version-bumper