Add failsafe to branch detection

This commit is contained in:
Mustafa Gezen 2021-06-01 17:40:24 +02:00
parent 4c689576dc
commit cd1fbccc74
1 changed files with 1 additions and 1 deletions

View File

@ -294,7 +294,7 @@ func patchModuleYaml(pd *data.ProcessData, md *data.ModeData) {
// versions are not that important
if strings.HasPrefix(rpm.Ref, "stream-rhel-rhel-") {
pushBranch = defaultBranch
} else if strings.HasPrefix(rpm.Ref, "stream-rhel-") {
} else if strings.HasPrefix(rpm.Ref, "stream-rhel-") && len(split) > 4 {
repString := fmt.Sprintf("%s%ss-", pd.BranchPrefix, string(split[4][0]))
newString := fmt.Sprintf("%s%s-", pd.BranchPrefix, string(split[4][0]))
pushBranch = strings.Replace(md.PushBranch, repString, newString, 1)