Skip to content

Config-file step to generate $version, but not actually update files #1959

Description

@BatmanAoD

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions