I would like to have a way to get the "next version" that will be generated from the current commit history. Right now, the best approach I can think of is to actually prepare a release, then undo the changes:
[[workflows.steps]]
type = "Command"
shell = true
command = """
if ! git diff --staged --exit-code . >/dev/null; then
echo "Error: cannot run get-next-version when there are changes in the repo. Please commit or stash."
exit 1
fi
"""
[[workflows.steps]]
type = "PrepareRelease"
[[workflows.steps]]
type = "Command"
command = 'echo "$version"'
[[workflows.steps]]
type = "Command"
command = """
git restore --source=HEAD .
"""
This seems pretty brittle, though.
I would like to have a way to get the "next version" that will be generated from the current commit history. Right now, the best approach I can think of is to actually prepare a release, then undo the changes:
This seems pretty brittle, though.