diff --git a/pkg/sarif/reporter_test.go b/pkg/sarif/reporter_test.go index d9e7190..4d82302 100644 --- a/pkg/sarif/reporter_test.go +++ b/pkg/sarif/reporter_test.go @@ -4,6 +4,8 @@ import ( "bytes" "encoding/json" "io" + "os" + "path" "testing" "github.com/Templum/govulncheck-action/pkg/types" @@ -14,7 +16,8 @@ import ( ) func TestSarifReporter_Convert(t *testing.T) { - scanner := helper.NewScanner(zerolog.Nop(), "", true) + wd, _ := os.Getwd() + scanner := helper.NewScanner(zerolog.Nop(), path.Join(wd, "..", ".."), true) result, _ := scanner.Scan() t.Run("Should convert a preprocessed report into sarif format", func(t *testing.T) { diff --git a/pkg/vulncheck/runner.go b/pkg/vulncheck/runner.go index 23d2ba1..4ea9457 100644 --- a/pkg/vulncheck/runner.go +++ b/pkg/vulncheck/runner.go @@ -126,7 +126,7 @@ func vulncheckCli(workDir string, command string, flag string, pkg string) ([]by } func staticLocalCli(workDir string, command string, flag string, pkg string) ([]byte, error) { - path := path.Join("..", "..", "hack", "found.stream") + path := path.Join(workDir, "hack", "found.stream") out, _ := os.ReadFile(path) return out, nil