Skip to content

Commit

Permalink
feat: argument to print compiled version (#36)
Browse files Browse the repository at this point in the history
closes #19
  • Loading branch information
cx-monicac authored Apr 13, 2023
1 parent a967c08 commit 9e5886b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ jobs:
if: ${{ steps.semantic_release_info.outputs.git_tag }}
run: go test ./...

- name: Go Mod Tidy
if: ${{ steps.semantic_release_info.outputs.git_tag }}
run: go mod tidy

- name: Go Build
if: ${{ steps.semantic_release_info.outputs.git_tag }}
env:
VERSION: ${{ steps.semantic_release_info.outputs.version }}
CGO_ENABLED: 0
GOOS: linux
GOARCH: amd64
run: go build -ldflags "-s -w -X github.com/checkmarx/2ms/cmd.Version=$VERSION" -a -installsuffix cgo -o bin/2ms main.go

- name: Creating Release
if: ${{ steps.semantic_release_info.outputs.git_tag }}
uses: softprops/action-gh-release@v0.1.15
Expand All @@ -38,3 +51,7 @@ jobs:
name: ${{ steps.semantic_release_info.outputs.git_tag }}
body: ${{ steps.semantic_release_info.outputs.notes }}
target_commitish: ${{ steps.commit_and_push.outputs.latest_commit_hash }}
files: bin/2ms



9 changes: 6 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ import (
)

var rootCmd = &cobra.Command{
Use: "2ms",
Short: "2ms Secrets Detection",
Run: execute,
Use: "2ms",
Short: "2ms Secrets Detection",
Run: execute,
Version: Version,
}

var Version = ""

var allPlugins = []plugins.IPlugin{
&plugins.ConfluencePlugin{},
}
Expand Down

0 comments on commit 9e5886b

Please sign in to comment.