@@ -67,39 +67,10 @@ public class GitHubActionsBuildServer : BaseBuildServer
67
67
throw new ArgumentNullException ( nameof ( data ) ) ;
68
68
}
69
69
70
- // Group annotations by provider type and run
71
- var groupedIssues =
72
- from issue in data . Issues
73
- group issue by new { issue . ProviderType , issue . Run } ;
74
-
75
- foreach ( var group in groupedIssues )
76
- {
77
- var groupName = group . First ( ) . ProviderName ;
78
-
79
- if ( ! string . IsNullOrWhiteSpace ( group . Key . Run ) )
80
- {
81
- groupName += " - " + group . Key . Run ;
82
- }
83
-
84
- context . Information ( $ "::group::{ groupName } ") ;
85
-
86
- foreach ( var issue in group . OrderByDescending ( x => x . Priority ) )
87
- {
88
- // Commands don't support line breaks, therefore we only use the first line of the message.
89
- var message =
90
- issue . MessageText
91
- . Split ( new [ ] { '\n ' } , StringSplitOptions . RemoveEmptyEntries )
92
- . FirstOrDefault ( )
93
- ? . Trim ( ) ;
94
-
95
- var rootDirectoryPath =
96
- data . RepositoryRootDirectory . GetRelativePath ( data . BuildRootDirectory ) ;
97
-
98
- context . Information ( $ "::warning { FormatWarningOptions ( rootDirectoryPath , issue . AffectedFileRelativePath , issue . Line , issue . Column ) } ::{ message } ") ;
99
- }
100
-
101
- context . Information ( $ "::endgroup::{ groupName } ") ;
102
- }
70
+ context . ReportIssuesToPullRequest (
71
+ data . Issues ,
72
+ context . GitHubActionsBuilds ( ) ,
73
+ data . BuildRootDirectory ) ;
103
74
}
104
75
105
76
/// <inheritdoc />
@@ -136,34 +107,4 @@ public class GitHubActionsBuildServer : BaseBuildServer
136
107
137
108
// Publishing artifacts is currently not supported for GitHub Actions.
138
109
}
139
-
140
- /// <summary>
141
- /// Formats the options for the warning service message.
142
- /// </summary>
143
- /// <param name="rootDirectoryPath">The root path of the file, relative to the repository root.</param>
144
- /// <param name="filePath">The file path relative to the project root.</param>
145
- /// <param name="line">The line where the issue ocurred.</param>
146
- /// <param name="column">The column where the issue ocurred.</param>
147
- /// <returns>Formatted options string for the warning service message.</returns>
148
- private static string FormatWarningOptions ( DirectoryPath rootDirectoryPath , FilePath filePath , int ? line , int ? column )
149
- {
150
- var result = new List < string > ( ) ;
151
-
152
- if ( filePath != null )
153
- {
154
- result . Add ( $ "file={ rootDirectoryPath . CombineWithFilePath ( filePath ) } ") ;
155
- }
156
-
157
- if ( line . HasValue )
158
- {
159
- result . Add ( $ "line={ line . Value } ") ;
160
- }
161
-
162
- if ( column . HasValue )
163
- {
164
- result . Add ( $ "col={ column } ") ;
165
- }
166
-
167
- return string . Join ( "," , result ) ;
168
- }
169
110
}
0 commit comments