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
2 changes: 2 additions & 0 deletions cmd/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ 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"
)

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)
},
Expand Down
2 changes: 2 additions & 0 deletions cmd/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ 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"
)

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)
},
Expand Down
2 changes: 2 additions & 0 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ 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"
)

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 {
Expand Down
6 changes: 6 additions & 0 deletions internal/version/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package version

import "log"

var version = "development"
var commit = "0000000000000000000000000000000000000000"

Expand All @@ -10,3 +12,7 @@ func Version() string {
func Commit() string {
return commit
}

func LogVersion() {
log.Printf("Starting CodeQL Action sync tool version %s...", Version())
}