@@ -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 } from "./config-utils" ;
22+ import {
23+ Config ,
24+ getConfig ,
25+ isCodeQualityEnabled ,
26+ isCodeScanningEnabled ,
27+ } from "./config-utils" ;
2328import { uploadDatabases } from "./database-upload" ;
2429import {
2530 DependencyCacheUploadStatusReport ,
@@ -344,13 +349,41 @@ async function run() {
344349 const checkoutPath = actionsUtil . getRequiredInput ( "checkout_path" ) ;
345350 const category = actionsUtil . getOptionalInput ( "category" ) ;
346351
347- uploadResults = await uploadSarif (
348- logger ,
349- features ,
350- checkoutPath ,
351- outputDir ,
352- category ,
353- ) ;
352+ if ( await features . getValue ( Feature . AnalyzeUseNewUpload ) ) {
353+ uploadResults = await uploadSarif (
354+ logger ,
355+ features ,
356+ checkoutPath ,
357+ outputDir ,
358+ category ,
359+ ) ;
360+ } else {
361+ uploadResults = { } ;
362+
363+ if ( isCodeScanningEnabled ( config ) ) {
364+ uploadResults [ analyses . AnalysisKind . CodeScanning ] =
365+ await uploadLib . uploadFiles (
366+ outputDir ,
367+ actionsUtil . getRequiredInput ( "checkout_path" ) ,
368+ actionsUtil . getOptionalInput ( "category" ) ,
369+ features ,
370+ logger ,
371+ analyses . CodeScanning ,
372+ ) ;
373+ }
374+
375+ if ( isCodeQualityEnabled ( config ) ) {
376+ uploadResults [ analyses . AnalysisKind . CodeQuality ] =
377+ await uploadLib . uploadFiles (
378+ outputDir ,
379+ actionsUtil . getRequiredInput ( "checkout_path" ) ,
380+ actionsUtil . getOptionalInput ( "category" ) ,
381+ features ,
382+ logger ,
383+ analyses . CodeQuality ,
384+ ) ;
385+ }
386+ }
354387
355388 core . setOutput (
356389 "sarif-id" ,
0 commit comments