Release extract-version
release extract-version - Extract and validate release version from tag or input
The release extract-version command extracts version information from a git tag ref or explicit version input, validates the format (semver or calver), and outputs structured data for use in release workflows.
This command replaces the extract-release-version GitHub Action with pure Go logic, making it testable and usable locally.
Expected Output (--format shell): VERSION="1.0.0" TAG_NAME="r2r-cli/1.0.0" IS_VALID="true"
Flags
| Flag | Description |
|---|---|
--module |
Module prefix (e.g., r2r-cli, docs) |
--type (default: semver) |
Version type (semver or calver) |
--ref |
Git ref (e.g., refs/tags/r2r-cli/1.0.0) |
--version |
Explicit version (for workflow_dispatch) |
--format (default: shell) |
Output format (shell, json, yaml) |
Examples
release extract-version --module r2r-cli --ref refs/tags/r2r-cli/1.0.0
release extract-version --module docs --type calver --version ""
eval $(release extract-version --module r2r-cli --ref "$GITHUB_REF" --format shell)
See Also
Tutorials | How-to Guides | Explanation | Reference
You are here: Reference — information-oriented technical descriptions of the system.