@@ -31,6 +31,9 @@ public CSharpAutobuildOptions(IBuildActions actions) : base(actions)
31
31
32
32
public class CSharpAutobuilder : Autobuilder < CSharpAutobuildOptions >
33
33
{
34
+ private const string buildCommandDocsUrl =
35
+ "https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages" ;
36
+
34
37
private DotNetRule ? dotNetRule ;
35
38
36
39
private MsBuildRule ? msBuildRule ;
@@ -150,15 +153,15 @@ protected override void AutobuildFailureDiagnostic()
150
153
"CodeQL found multiple potential build scripts for your project and " +
151
154
$ "attempted to run `{ buildCommandAutoRule . ScriptPath } `, which failed. " +
152
155
"This may not be the right build script for your project. " +
153
- "You can specify which build script to use by providing a suitable build command for your project .";
156
+ $ "Set up a [manual build command]( { buildCommandDocsUrl } ) .";
154
157
}
155
158
else
156
159
{
157
160
message = MakeDiagnostic ( "script-failure" , "Unable to build project using build script" ) ;
158
161
message . MarkdownMessage =
159
162
"CodeQL attempted to build your project using a script located at " +
160
163
$ "`{ buildCommandAutoRule . ScriptPath } `, which failed. " +
161
- "You can manually specify a suitable build command for your project .";
164
+ $ "Set up a [manual build command]( { buildCommandDocsUrl } ) .";
162
165
}
163
166
164
167
message . Severity = DiagnosticMessage . TspSeverity . Error ;
@@ -172,7 +175,7 @@ protected override void AutobuildFailureDiagnostic()
172
175
var message = MakeDiagnostic ( "no-projects-or-solutions" , "No project or solutions files found" ) ;
173
176
message . PlaintextMessage =
174
177
"CodeQL could not find any project or solution files in your repository. " +
175
- "You can manually specify a suitable build command for your project .";
178
+ $ "Set up a [manual build command]( { buildCommandDocsUrl } ) .";
176
179
message . Severity = DiagnosticMessage . TspSeverity . Error ;
177
180
178
181
AddDiagnostic ( message ) ;
@@ -195,8 +198,7 @@ protected override void AutobuildFailureDiagnostic()
195
198
message . MarkdownMessage =
196
199
"CodeQL was unable to build the following projects using .NET Core:\n " +
197
200
string . Join ( '\n ' , dotNetRule . FailedProjectsOrSolutions . Select ( p => $ "- `{ p . FullPath } `") ) +
198
- "\n You can manually specify a suitable build command for your project to exclude these projects " +
199
- "or to ensure that they can be built successfully." ;
201
+ $ "\n Set up a [manual build command]({ buildCommandDocsUrl } ).";
200
202
message . Severity = DiagnosticMessage . TspSeverity . Error ;
201
203
202
204
AddDiagnostic ( message ) ;
@@ -209,8 +211,7 @@ protected override void AutobuildFailureDiagnostic()
209
211
message . MarkdownMessage =
210
212
"CodeQL was unable to build the following projects using MSBuild:\n " +
211
213
string . Join ( '\n ' , msBuildRule . FailedProjectsOrSolutions . Select ( p => $ "- `{ p . FullPath } `") ) +
212
- "\n You can manually specify a suitable build command for your project to exclude these projects " +
213
- "or to ensure that they can be built successfully." ; ;
214
+ $ "\n Set up a [manual build command]({ buildCommandDocsUrl } ).";
214
215
message . Severity = DiagnosticMessage . TspSeverity . Error ;
215
216
216
217
AddDiagnostic ( message ) ;
0 commit comments