Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shohamroditimemphis committed Oct 30, 2023
1 parent 22e49fc commit f557401
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions server/source_code_management_github_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@ func GetGithubContentFromConnectedRepo(connectedRepo map[string]interface{}, fun
continue
}

splitPath := strings.Split(*fileContent.Path, "/")
path := strings.TrimSpace(splitPath[0])
if path != contentMap["function_name"].(string) {
serv.Warnf("[tenant: %s]]GetGithubContentFromConnectedRepo: In the repository %s, function name %s in git doesn't match the function_name field %s in YAML file.", tenantName, repo, splitPath[0], contentMap["function_name"].(string))
continue
}
if strings.Contains(path, "") {
serv.Warnf("[tenant: %s]GetGithubContentFromConnectedRepo: In the repository %s, the function name %s in the YAML file cannot contain spaces", tenantName, repo, contentMap["function_name"].(string))
continue
}

if isValidFileYaml {
countFunctions++
fileDetails := functionDetails{
Expand All @@ -168,16 +179,6 @@ func GetGithubContentFromConnectedRepo(connectedRepo map[string]interface{}, fun
functionsDetails["other"] = append(functionsDetails["other"], fileDetails)
break
}
splitPath := strings.Split(*fileContent.Path, "/")
path := strings.TrimSpace(splitPath[0])
if path != contentMap["function_name"].(string) {
serv.Warnf("[tenant: %s]]GetGithubContentFromConnectedRepo: In the repository %s, function name %s in git doesn't match the function_name field %s in YAML file.", tenantName, repo, splitPath[0], contentMap["function_name"].(string))
continue
}
if strings.Contains(path, "") {
serv.Warnf("[tenant: %s]GetGithubContentFromConnectedRepo: In the repository %s, the function name %s in the YAML file cannot contain spaces", tenantName, repo, contentMap["function_name"].(string))
continue
}
}
}
if !isValidFileYaml {
Expand Down

0 comments on commit f557401

Please sign in to comment.