@@ -127,20 +127,23 @@ func (impl GitHubClient) CreateRepository(ctx context.Context, config *bean2.Git
127
127
}
128
128
private := true
129
129
// visibility := "private"
130
- r , _ , err := impl .client .Repositories .Create (ctx , impl .org ,
130
+ r , _ , err1 := impl .client .Repositories .Create (ctx , impl .org ,
131
131
& github.Repository {Name : & config .GitRepoName ,
132
132
Description : & config .Description ,
133
133
Private : & private ,
134
134
// Visibility: &visibility,
135
135
})
136
- if err != nil {
136
+ if err1 != nil {
137
137
impl .logger .Errorw ("error in creating github repo, " , "repo" , config .GitRepoName , "err" , err )
138
- detailedErrorGitOpsConfigActions . StageErrorMap [ CreateRepoStage ] = err
138
+
139
139
url , err = impl .GetRepoUrl (config )
140
140
if err != nil {
141
141
impl .logger .Errorw ("error in getting github repo" , "repo" , config .GitRepoName , "err" , err )
142
+ detailedErrorGitOpsConfigActions .StageErrorMap [CreateRepoStage ] = err1
142
143
return "" , true , detailedErrorGitOpsConfigActions
143
144
}
145
+ detailedErrorGitOpsConfigActions .SuccessfulStages = append (detailedErrorGitOpsConfigActions .SuccessfulStages , GetRepoUrlStage )
146
+ return url , false , detailedErrorGitOpsConfigActions
144
147
}
145
148
impl .logger .Infow ("github repo created " , "r" , r .CloneURL )
146
149
detailedErrorGitOpsConfigActions .SuccessfulStages = append (detailedErrorGitOpsConfigActions .SuccessfulStages , CreateRepoStage )
0 commit comments