@@ -195,8 +195,8 @@ func getGitRepoInfoFromEnvironment() (*gitview.GitRepoInfo, error) {
195195 return getGitRepoInfoFromAzureDevops (), nil
196196 case circleci :
197197 return getGitRepoInfoFromCircleci (), nil
198- case codeBuild :
199- return getGitRepoInfoFromCodeBuild (), nil
198+ // case codeBuild:
199+ // return getGitRepoInfoFromCodeBuild(), nil
200200 case unknown :
201201 return nil , nil
202202 }
@@ -205,9 +205,10 @@ func getGitRepoInfoFromEnvironment() (*gitview.GitRepoInfo, error) {
205205
206206func getGitRepoInfoFromGitHub () * gitview.GitRepoInfo {
207207 return & gitview.GitRepoInfo {
208- URL : fmt .Sprintf ("%s/%s" , os .Getenv ("GITHUB_SERVER_URL" ), os .Getenv ("GITHUB_REPOSITORY" )),
209- Name : os .Getenv ("GITHUB_REPOSITORY" ),
210- ID : os .Getenv ("GITHUB_REPOSITORY_ID" ),
208+ URL : fmt .Sprintf ("%s/%s" , os .Getenv ("GITHUB_SERVER_URL" ), os .Getenv ("GITHUB_REPOSITORY" )),
209+ Name : os .Getenv ("GITHUB_REPOSITORY" ),
210+ ID : os .Getenv ("GITHUB_REPOSITORY_ID" ),
211+ Provider : "github" ,
211212 }
212213}
213214
@@ -217,34 +218,38 @@ func getGitRepoInfoFromGitLab() *gitview.GitRepoInfo {
217218 Name : os .Getenv ("CI_PROJECT_PATH" ),
218219 ID : os .Getenv ("CI_PROJECT_ID" ),
219220 Description : os .Getenv ("CI_PROJECT_DESCRIPTION" ),
221+ Provider : "gitlab" ,
220222 }
221223}
222224
223225func getGitRepoInfoFromBitbucket () * gitview.GitRepoInfo {
224226 return & gitview.GitRepoInfo {
225- URL : os .Getenv ("BITBUCKET_GIT_HTTP_ORIGIN" ),
226- Name : os .Getenv ("BITBUCKET_REPO_FULL_NAME" ),
227- ID : os .Getenv ("BITBUCKET_REPO_UUID" ),
227+ URL : os .Getenv ("BITBUCKET_GIT_HTTP_ORIGIN" ),
228+ Name : os .Getenv ("BITBUCKET_REPO_FULL_NAME" ),
229+ ID : os .Getenv ("BITBUCKET_REPO_UUID" ),
230+ Provider : "bitbucket" ,
228231 }
229232}
230233
231234func getGitRepoInfoFromAzureDevops () * gitview.GitRepoInfo {
232235 return & gitview.GitRepoInfo {
233- URL : os .Getenv ("BUILD_REPOSITORY_URI" ),
234- Name : os .Getenv ("BUILD_REPOSITORY_NAME" ),
235- ID : os .Getenv ("BUILD_REPOSITORY_ID" ),
236+ URL : os .Getenv ("BUILD_REPOSITORY_URI" ),
237+ Name : os .Getenv ("BUILD_REPOSITORY_NAME" ),
238+ ID : os .Getenv ("BUILD_REPOSITORY_ID" ),
239+ Provider : "azure-devops" ,
236240 }
237241}
238242
239243func getGitRepoInfoFromCircleci () * gitview.GitRepoInfo {
240244 return & gitview.GitRepoInfo {
241- URL : os .Getenv ("CIRCLE_REPOSITORY_URL" ),
242- Name : os .Getenv ("CIRCLE_PROJECT_REPONAME" ),
245+ URL : os .Getenv ("CIRCLE_REPOSITORY_URL" ),
246+ Name : os .Getenv ("CIRCLE_PROJECT_REPONAME" ),
247+ Provider : "circleci" ,
243248 }
244249}
245250
246- func getGitRepoInfoFromCodeBuild () * gitview.GitRepoInfo {
247- return & gitview.GitRepoInfo {
248- URL : os .Getenv ("CODEBUILD_SOURCE_REPO_URL" ),
249- }
250- }
251+ // func getGitRepoInfoFromCodeBuild() *gitview.GitRepoInfo {
252+ // return &gitview.GitRepoInfo{
253+ // URL: os.Getenv("CODEBUILD_SOURCE_REPO_URL"),
254+ // }
255+ // }
0 commit comments