File tree Expand file tree Collapse file tree 3 files changed +29
-18
lines changed Expand file tree Collapse file tree 3 files changed +29
-18
lines changed Original file line number Diff line number Diff line change @@ -137,4 +137,10 @@ export enum EnvVar {
137137 * This setting is more specific than `CODEQL_ACTION_TEST_MODE`, which implies this option.
138138 */
139139 SKIP_SARIF_UPLOAD = "CODEQL_ACTION_SKIP_SARIF_UPLOAD" ,
140+
141+ /**
142+ * Whether to skip workflow validation. Intended for internal use, where we know that
143+ * the workflow is valid and validation is not necessary.
144+ */
145+ SKIP_WORKFLOW_VALIDATION = "CODEQL_ACTION_SKIP_WORKFLOW_VALIDATION" ,
140146}
Original file line number Diff line number Diff line change @@ -288,16 +288,19 @@ async function run() {
288288 toolsSource = initCodeQLResult . toolsSource ;
289289 zstdAvailability = initCodeQLResult . zstdAvailability ;
290290
291- core . startGroup ( "Validating workflow" ) ;
292- const validateWorkflowResult = await validateWorkflow ( codeql , logger ) ;
293- if ( validateWorkflowResult === undefined ) {
294- logger . info ( "Detected no issues with the code scanning workflow." ) ;
295- } else {
296- logger . warning (
297- `Unable to validate code scanning workflow: ${ validateWorkflowResult } ` ,
298- ) ;
291+ // Check the workflow for problems, unless `SKIP_WORKFLOW_VALIDATION` is `true`.
292+ if ( process . env [ EnvVar . SKIP_WORKFLOW_VALIDATION ] !== "true" ) {
293+ core . startGroup ( "Validating workflow" ) ;
294+ const validateWorkflowResult = await validateWorkflow ( codeql , logger ) ;
295+ if ( validateWorkflowResult === undefined ) {
296+ logger . info ( "Detected no issues with the code scanning workflow." ) ;
297+ } else {
298+ logger . warning (
299+ `Unable to validate code scanning workflow: ${ validateWorkflowResult } ` ,
300+ ) ;
301+ }
302+ core . endGroup ( ) ;
299303 }
300- core . endGroup ( ) ;
301304
302305 // Set CODEQL_ENABLE_EXPERIMENTAL_FEATURES for Rust if between 2.19.3 (included) and 2.22.1 (excluded)
303306 // We need to set this environment variable before initializing the config, otherwise Rust
You can’t perform that action at this time.
0 commit comments