diff --git a/cmd/pull.go b/cmd/pull.go index b221c33..37cfeb9 100644 --- a/cmd/pull.go +++ b/cmd/pull.go @@ -3,6 +3,7 @@ package cmd import ( "github.com/github/codeql-action-sync/internal/cachedirectory" "github.com/github/codeql-action-sync/internal/pull" + "github.com/github/codeql-action-sync/internal/version" "github.com/spf13/cobra" ) @@ -10,6 +11,7 @@ var pullCmd = &cobra.Command{ Use: "pull", Short: "Pull the CodeQL Action from GitHub to a local cache.", RunE: func(cmd *cobra.Command, args []string) error { + version.LogVersion() cacheDirectory := cachedirectory.NewCacheDirectory(rootFlags.cacheDir) return pull.Pull(cmd.Context(), cacheDirectory) }, diff --git a/cmd/push.go b/cmd/push.go index bcdc218..c40048a 100644 --- a/cmd/push.go +++ b/cmd/push.go @@ -3,6 +3,7 @@ package cmd import ( "github.com/github/codeql-action-sync/internal/cachedirectory" "github.com/github/codeql-action-sync/internal/push" + "github.com/github/codeql-action-sync/internal/version" "github.com/spf13/cobra" ) @@ -10,6 +11,7 @@ var pushCmd = &cobra.Command{ Use: "push", Short: "Push the CodeQL Action from the local cache to a GitHub Enterprise Server installation.", RunE: func(cmd *cobra.Command, args []string) error { + version.LogVersion() cacheDirectory := cachedirectory.NewCacheDirectory(rootFlags.cacheDir) return push.Push(cmd.Context(), cacheDirectory, pushFlags.destinationURL, pushFlags.destinationToken, pushFlags.destinationRepository) }, diff --git a/cmd/sync.go b/cmd/sync.go index 301ed48..cbc5f51 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -4,6 +4,7 @@ import ( "github.com/github/codeql-action-sync/internal/cachedirectory" "github.com/github/codeql-action-sync/internal/pull" "github.com/github/codeql-action-sync/internal/push" + "github.com/github/codeql-action-sync/internal/version" "github.com/spf13/cobra" ) @@ -11,6 +12,7 @@ var syncCmd = &cobra.Command{ Use: "sync", Short: "Sync the CodeQL Action from GitHub to a GitHub Enterprise Server installation.", RunE: func(cmd *cobra.Command, args []string) error { + version.LogVersion() cacheDirectory := cachedirectory.NewCacheDirectory(rootFlags.cacheDir) err := pull.Pull(cmd.Context(), cacheDirectory) if err != nil { diff --git a/internal/version/version.go b/internal/version/version.go index 49ab828..2da730a 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -1,5 +1,7 @@ package version +import "log" + var version = "development" var commit = "0000000000000000000000000000000000000000" @@ -10,3 +12,7 @@ func Version() string { func Commit() string { return commit } + +func LogVersion() { + log.Printf("Starting CodeQL Action sync tool version %s...", Version()) +}