Skip to content

Commit

Permalink
ci(sast): fixed SAST tool warnings
Browse files Browse the repository at this point in the history
Signed-off-by: k4yt3x <[email protected]>
  • Loading branch information
k4yt3x committed Sep 4, 2024
1 parent 1feb42f commit dc6ce37
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Exceptions are acceptable depending on the circumstances (critical bug fixes tha

### Fixed

- fixed SAST tool warnings
- fixed a typo in authentication method selection

## [2.14.0] - 2024-03-01
Expand Down
15 changes: 12 additions & 3 deletions cmd/autobump/git_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main

import (
"crypto/rand"
"fmt"
"math/rand"
"math/big"
"testing"

"github.com/go-faker/faker/v4"
Expand Down Expand Up @@ -155,8 +156,16 @@ func TestGetLatestTag_Success(t *testing.T) {
head, err := repo.Head()
require.NoError(t, err)

// Create a tag on the commit
testTag := fmt.Sprintf("%d.%d.%d", rand.Intn(10), rand.Intn(10), rand.Intn(10))
// Create a random tag on the commit
randMax := big.NewInt(10)
major, err := rand.Int(rand.Reader, randMax)
require.NoError(t, err)
minor, err := rand.Int(rand.Reader, randMax)
require.NoError(t, err)
patch, err := rand.Int(rand.Reader, randMax)
require.NoError(t, err)

testTag := fmt.Sprintf("%d.%d.%d", major, minor, patch)
_, err = repo.CreateTag(testTag, head.Hash(), nil)
require.NoError(t, err)

Expand Down
14 changes: 12 additions & 2 deletions horusec.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"horusecCliFalsePositiveHashes": [],
"horusecCliRiskAcceptHashes": []
"horusecCliFalsePositiveHashes": [
"e56f980ae1b2ef6b01c86f493be3cc5c374bdc550acdc5d1eb9d152419578b9d"
],
"horusecCliRiskAcceptHashes": [
"560ba363f658af6c83e47bb0109356868c073a9c0fed0e4f7c6b633bf7ce77b5",
"dfb23abce8d2f48ffecebf436cf7cee39387c5d90882f2788830d7dd4d6054cd",
"7b5c7b22ecf9ab317402793b0705e0a82f669bf7bc640e1d6fcbbcdef0f3102f",
"ddc0ef41bbeeb7556c55f7a0c64ee20d919ca2e380f7e85fa5374c58dc877e73",
"282e477e1f992ca495bf244a7eff533d539e6bbb2e93c1874cfb79c4ef9e8682",
"db01586a8bf00075b621deb2123ca082fc576afb5c0528fddf774a13cd6a42ca",
"391bfdf65c05a160475a7665846c3ae9f3068cadfddcf2a44bde034bb2038ee0"
]
}

0 comments on commit dc6ce37

Please sign in to comment.