Skip to content

Commit

Permalink
List downloaded artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
pwntester committed Oct 26, 2023
1 parent 4aa9205 commit 2c13e0f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,9 @@ func downloadArtifact(url string, task models.DownloadTask) error {
log.Fatal(err)
}

downloadedFiles := []string{}
for _, zf := range zipReader.File {

if zf.Name != "results.sarif" && zf.Name != "results.bqrs" {
continue
}
Expand Down Expand Up @@ -581,9 +583,15 @@ func downloadArtifact(url string, task models.DownloadTask) error {
if err != nil {
return err
}
downloadedFiles = append(downloadedFiles, resultPath)
}

if len(downloadedFiles) == 0 {
return errors.New("No results files found in artifact")
} else {
fmt.Println("Downloaded", downloadedFiles)
return nil
}
return errors.New("No results.sarif file found in artifact")
}

func DownloadResults(task models.DownloadTask) error {
Expand Down

0 comments on commit 2c13e0f

Please sign in to comment.