@@ -110,6 +110,11 @@ var codeScanningCmd = &cobra.Command{
110110 }
111111 }
112112
113+ var pullRequests []string
114+ var defaultScan []string
115+ var noLanguage []string
116+ var advancedSetup []string
117+
113118 for _ , repo := range repos {
114119
115120 log .Printf ("Details for Repository: Full Name: %s; Name: %s; Default Branch: %s\n " , repo .FullName , repo .Name , repo .DefaultBranch )
@@ -122,6 +127,7 @@ var codeScanningCmd = &cobra.Command{
122127
123128 if len (coverage ) <= 0 {
124129 log .Printf ("No CodeQL supported language found for repository: %s" , repo .FullName )
130+ noLanguage = append (noLanguage , repo .FullName )
125131 continue
126132 }
127133
@@ -134,6 +140,7 @@ var codeScanningCmd = &cobra.Command{
134140 }
135141 if isDefaultSetupEnabled == true {
136142 log .Printf ("Default setup already enabled for this repository: %s, skipping enablement." , repo .FullName )
143+ defaultScan = append (defaultScan , repo .FullName )
137144 continue
138145 }
139146
@@ -146,6 +153,7 @@ var codeScanningCmd = &cobra.Command{
146153 }
147154 if isCodeQLEnabled == true {
148155 log .Printf ("CodeQL workflow file already exists for this repository: %s, skipping enablement." , repo .FullName )
156+ advancedSetup = append (advancedSetup , repo .FullName )
149157 continue
150158 }
151159
@@ -183,15 +191,48 @@ var codeScanningCmd = &cobra.Command{
183191 continue
184192 }
185193 log .Printf ("Successfully raised pull request %s on branch %s in repository %s\n " , createdPR , newbranchref , repo .FullName )
194+ pullRequests = append (pullRequests , createdPR )
186195
187196 }
188197 log .Printf ("Number of repos processed: %d\n " , len (repos ))
189198 if len (Errors ) == 0 {
190199 log .Println ("No errors where found when enabling code scanning" )
191200 }
192- for k , v := range Errors {
193201
194- log .Printf ("ERROR: Repository: [%s] Message: [%s]\n " , k , v )
202+ if len (noLanguage ) > 0 {
203+ log .Printf ("Repositories with no CodeQL supported language: %d\n " , len (noLanguage ))
204+ for _ , repo := range noLanguage {
205+ log .Printf ("Repository: %s\n " , repo )
206+ }
207+ }
208+
209+ if len (defaultScan ) > 0 {
210+ log .Printf ("Repositories with default setup already enabled: %d\n " , len (defaultScan ))
211+ for _ , repo := range defaultScan {
212+ log .Printf ("Repository: %s\n " , repo )
213+ }
214+ }
215+
216+ if len (advancedSetup ) > 0 {
217+ log .Printf ("Repositories with advanced setup already enabled: %d\n " , len (advancedSetup ))
218+ for _ , repo := range advancedSetup {
219+ log .Printf ("Repository: %s\n " , repo )
220+ }
221+ }
222+
223+ if len (pullRequests ) > 0 {
224+ log .Printf ("Pull requests raised: %d\n " , len (pullRequests ))
225+ for _ , pr := range pullRequests {
226+ log .Printf ("PR URL: %s\n " , pr )
227+ }
228+ }
229+
230+ if len (Errors ) > 0 {
231+ log .Printf ("Repositories with errors: %d\n " , len (Errors ))
232+ for k , v := range Errors {
233+
234+ log .Printf ("Repository: %s Message: [%s]\n " , k , v )
235+ }
195236 }
196237
197238 log .Printf ("Finished enable code scanning! \n " )
0 commit comments