Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"github.com/open-delivery-spec/cli/internal/validator"
"github.com/open-delivery-spec/cli/internal/version"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand All @@ -29,7 +30,7 @@ delivery artifacts compliant with the Open Delivery Spec.

Validate branch names, commit messages, PR descriptions,
release readiness reports, rollback plans, and more.`,
Version: "1.0.0",
Version: version.Value,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
if schemaDir != "" {
return validator.LoadSchemasFromDir(schemaDir)
Expand Down
3 changes: 2 additions & 1 deletion internal/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

"github.com/open-delivery-spec/cli/internal/policy"
"github.com/open-delivery-spec/cli/internal/validator"
"github.com/open-delivery-spec/cli/internal/version"
)

type Status string
Expand Down Expand Up @@ -713,7 +714,7 @@ func SARIF(r Report) ([]byte, error) {
Tool: sarifTool{
Driver: sarifDriver{
Name: "ODS CLI",
Version: "1.0.0",
Version: version.Value,
InformationURI: "https://open-delivery-spec.github.io/spec",
Rules: buildSARIFRules(),
},
Expand Down
6 changes: 6 additions & 0 deletions internal/version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package version

// Value is the semantic version of the CLI, set via ldflags at build time.
// Default value is "dev" for development builds.
// Example: go build -ldflags="-X github.com/open-delivery-spec/cli/internal/version.Value=v0.2.1"
var Value = "dev"
Loading