Skip to content

Commit

Permalink
handle n/a value from orchestrator pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
hubadr committed Oct 24, 2024
1 parent bb99315 commit 514565e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/checkmarxOneExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,13 @@ func (c *checkmarxOneExecuteScanHelper) CreateScanRequest(incremental bool, uplo
} else if len(branch) == 0 && (len(c.config.GitBranch) == 0 || c.config.GitBranch == "n/a") { // use the branch from the orchestrator by default
cicdOrch, err := orchestrator.GetOrchestratorConfigProvider(nil)
if err == nil {
branch = cicdOrch.Branch()
log.Entry().Infof("CxOne scan branch was automatically set to : %v", branch)
cicdBranch := cicdOrch.Branch()
if cicdBranch != "n/a" {
branch = cicdBranch
log.Entry().Infof("CxOne scan branch was automatically set to : %v", branch)
} else {
log.Entry().Info("Could not retrieve branch name from orchestrator")
}
} else {
log.Entry().Info("Could not identify orchestrator and set the branch")
}
Expand Down

0 comments on commit 514565e

Please sign in to comment.