Skip to content

Commit 50864fe

Browse files
committed
Change Git default branch to main in update_rules tool
On-behalf-of: @SAP [email protected] Signed-off-by: Marko Mudrinić <[email protected]>
1 parent faa65a9 commit 50864fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/update-rules/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"k8s.io/publishing-bot/cmd/publishing-bot/config"
2828
)
2929

30-
const GitDefaultBranch = "master"
30+
const gitDefaultBranch = "main"
3131

3232
type options struct {
3333
branch string
@@ -149,7 +149,7 @@ func UpdateRules(rules *config.RepositoryRules, branch, goVer string, deleteRule
149149
// find the mainBranch rules
150150
for i := range r.Branches {
151151
br := r.Branches[i]
152-
if br.Name == GitDefaultBranch {
152+
if br.Name == gitDefaultBranch {
153153
cloneBranchRule(&br, &newBranchRule)
154154
mainBranchRuleFound = true
155155
break
@@ -158,7 +158,7 @@ func UpdateRules(rules *config.RepositoryRules, branch, goVer string, deleteRule
158158

159159
// if mainBranch rules not found for repo, it means it's removed from master tree, log warning and skip updating the rules
160160
if !mainBranchRuleFound {
161-
glog.Warningf("%s branch rules not found for repo %s, skipping to update branch %s rules", GitDefaultBranch, r.DestinationRepository, branch)
161+
glog.Warningf("%s branch rules not found for repo %s, skipping to update branch %s rules", gitDefaultBranch, r.DestinationRepository, branch)
162162
continue
163163
}
164164

0 commit comments

Comments
 (0)