@@ -113,10 +113,9 @@ export enum CliConfigErrorCategory {
113
113
}
114
114
115
115
type CliErrorConfiguration = {
116
- /** One of these snippets , or the exit code, must be present in the error message. */
117
- cliErrorMessageSnippets : RegExp [ ] ;
116
+ /** One of these candidates , or the exit code, must be present in the error message. */
117
+ cliErrorMessageCandidates : RegExp [ ] ;
118
118
exitCode ?: number ;
119
- // Optional additional message to append for this type of CLI error.
120
119
additionalErrorMessageToAppend ?: string ;
121
120
} ;
122
121
@@ -130,12 +129,12 @@ export const cliErrorsConfig: Record<
130
129
> = {
131
130
// Version of CodeQL CLI is incompatible with this version of the CodeQL Action
132
131
[ CliConfigErrorCategory . IncompatibleWithActionVersion ] : {
133
- cliErrorMessageSnippets : [
132
+ cliErrorMessageCandidates : [
134
133
new RegExp ( "is not compatible with this CodeQL CLI" ) ,
135
134
] ,
136
135
} ,
137
136
[ CliConfigErrorCategory . InitCalledTwice ] : {
138
- cliErrorMessageSnippets : [
137
+ cliErrorMessageCandidates : [
139
138
new RegExp (
140
139
"Refusing to create databases .* but could not process any of it" ,
141
140
) ,
@@ -144,15 +143,15 @@ export const cliErrorsConfig: Record<
144
143
} ,
145
144
// Expected source location for database creation does not exist
146
145
[ CliConfigErrorCategory . InvalidSourceRoot ] : {
147
- cliErrorMessageSnippets : [ new RegExp ( "Invalid source root" ) ] ,
146
+ cliErrorMessageCandidates : [ new RegExp ( "Invalid source root" ) ] ,
148
147
} ,
149
148
[ CliConfigErrorCategory . NoBuildCommandAutodetected ] : {
150
- cliErrorMessageSnippets : [
149
+ cliErrorMessageCandidates : [
151
150
new RegExp ( "Could not auto-detect a suitable build method" ) ,
152
151
] ,
153
152
} ,
154
153
[ CliConfigErrorCategory . NoBuildMethodAutodetected ] : {
155
- cliErrorMessageSnippets : [
154
+ cliErrorMessageCandidates : [
156
155
new RegExp (
157
156
"Could not detect a suitable build command for the source checkout" ,
158
157
) ,
@@ -162,7 +161,7 @@ export const cliErrorsConfig: Record<
162
161
// was unintended to have CodeQL analysis run on it.
163
162
[ CliConfigErrorCategory . NoSourceCodeSeen ] : {
164
163
exitCode : 32 ,
165
- cliErrorMessageSnippets : [
164
+ cliErrorMessageCandidates : [
166
165
new RegExp (
167
166
"CodeQL detected code written in .* but could not process any of it" ,
168
167
) ,
@@ -182,12 +181,14 @@ export const cliErrorsConfig: Record<
182
181
} ,
183
182
184
183
[ CliConfigErrorCategory . NoSupportedBuildCommandSucceeded ] : {
185
- cliErrorMessageSnippets : [
184
+ cliErrorMessageCandidates : [
186
185
new RegExp ( "No supported build command succeeded" ) ,
187
186
] ,
188
187
} ,
189
188
[ CliConfigErrorCategory . NoSupportedBuildSystemDetected ] : {
190
- cliErrorMessageSnippets : [ new RegExp ( "No supported build system detected" ) ] ,
189
+ cliErrorMessageCandidates : [
190
+ new RegExp ( "No supported build system detected" ) ,
191
+ ] ,
191
192
} ,
192
193
} ;
193
194
@@ -209,7 +210,7 @@ export function getCliConfigCategoryIfExists(
209
210
return category as CliConfigErrorCategory ;
210
211
}
211
212
212
- for ( const e of configuration . cliErrorMessageSnippets ) {
213
+ for ( const e of configuration . cliErrorMessageCandidates ) {
213
214
if ( cliError . message . match ( e ) || cliError . stderr . match ( e ) ) {
214
215
return category as CliConfigErrorCategory ;
215
216
}
0 commit comments