feat: export version as action outputs#5
Merged
Conversation
status mode now writes machine-readable step outputs (next-version, previous-version, bump, skip) instead of only human text, and uses the same ComputeNext as the release path so the two can't drift. status has no branch-config dependency, so consumers can read the next version on any branch (including PRs and feature branches). release/prerelease now expose a `version` output (the full computed version) in addition to `tag`, so the version is available even on the no-tag path where `tag` is empty. GITHUB_OUTPUT writing is consolidated into a single appendGitHubOutput helper.
|
Ready to review this PR? Stage has broken it down into 4 individual chapters for you:
Chapters generated by Stage for commit ade5978 on Jun 25, 2026 10:14am UTC. |
Contributor
Change file check✅ OK — 1 valid change file(s) added in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surfaces the version the tool already computes as proper GitHub Action outputs, so consuming workflows can read it directly instead of parsing logs or re-deriving it from git tags.
statusmode now writes machine-readable step outputs (next-version,previous-version,bump,skip) in addition to its human-readable text. It also now uses the sameComputeNextthe release path uses, so the version reported bystatuscan't drift from whatreleasewould tag.statushas no branch-config dependency, so consumers can read the next version on any branch — including PRs and feature branches not listed in.changes/config.json.release/prereleasenow expose aversionoutput (the full computed version string, i.e. the tag without prefix) alongsidetag. This makes the version available even on the no-tag path, wheretagis empty but the version is known (e.g.1.6.0-develop+gbb0c825).action.ymldeclares the new outputs:version,next-version,previous-version,bump.appendGitHubOutputhelper (removes the duplicated open/write/error-handling across the three writers).Motivation
In OpenShock/Firmware,
get-vars.jsindependently derived the build version from the latest git tag (no bump), while release-tool computed the next version from.changes/. The two diverged (1.5.2-develop+…vs1.6.0-develop+…), and dev/CI artifacts were labelled as a pre-release of the last release rather than the upcoming one. Exposing the version here letsget-varsconsume release-tool as the single source of truth.Testing
go build ./...,go vet ./cmd/...,go test ./...all pass.statusagainst the Firmware repo: emitsnext-version=1.6.0,previous-version=1.5.2,bump=minor,skip=false.