@@ -19,7 +19,12 @@ import { getApiDetails, getGitHubVersion } from "./api-client";
1919import { runAutobuild } from "./autobuild" ;
2020import { getTotalCacheSize , shouldStoreCache } from "./caching-utils" ;
2121import { getCodeQL } from "./codeql" ;
22- import { Config , getConfig , isCodeQualityEnabled } from "./config-utils" ;
22+ import {
23+ Config ,
24+ getConfig ,
25+ isCodeQualityEnabled ,
26+ isCodeScanningEnabled ,
27+ } from "./config-utils" ;
2328import { uploadDatabases } from "./database-upload" ;
2429import { uploadDependencyCaches } from "./dependency-caching" ;
2530import { getDiffInformedAnalysisBranches } from "./diff-informed-analysis-utils" ;
@@ -327,15 +332,17 @@ async function run() {
327332 core . setOutput ( "sarif-output" , path . resolve ( outputDir ) ) ;
328333 const uploadInput = actionsUtil . getOptionalInput ( "upload" ) ;
329334 if ( runStats && actionsUtil . getUploadValue ( uploadInput ) === "always" ) {
330- uploadResult = await uploadLib . uploadFiles (
331- outputDir ,
332- actionsUtil . getRequiredInput ( "checkout_path" ) ,
333- actionsUtil . getOptionalInput ( "category" ) ,
334- features ,
335- logger ,
336- analyses . CodeScanning ,
337- ) ;
338- core . setOutput ( "sarif-id" , uploadResult . sarifID ) ;
335+ if ( isCodeScanningEnabled ( config ) ) {
336+ uploadResult = await uploadLib . uploadFiles (
337+ outputDir ,
338+ actionsUtil . getRequiredInput ( "checkout_path" ) ,
339+ actionsUtil . getOptionalInput ( "category" ) ,
340+ features ,
341+ logger ,
342+ analyses . CodeScanning ,
343+ ) ;
344+ core . setOutput ( "sarif-id" , uploadResult . sarifID ) ;
345+ }
339346
340347 if ( isCodeQualityEnabled ( config ) ) {
341348 const qualityUploadResult = await uploadLib . uploadFiles (
0 commit comments