@@ -11,8 +11,9 @@ import {
1111 getRequiredInput ,
1212 isSelfHostedRunner ,
1313} from "./actions-util" ;
14+ import { AnalysisKind } from "./analyses" ;
1415import { getAnalysisKey , getApiClient } from "./api-client" ;
15- import { type Config } from "./config-utils" ;
16+ import { isCodeQualityEnabled , type Config } from "./config-utils" ;
1617import { DocUrl } from "./doc-url" ;
1718import { EnvVar } from "./environment" ;
1819import { getRef } from "./git-utils" ;
@@ -91,6 +92,8 @@ export interface StatusReportBase {
9192 action_version : string ;
9293 /** The name of the Actions event that triggered the workflow. */
9394 actions_event_name ?: string ;
95+ /** Comma-separated list of the kinds of analyses we are performing. */
96+ analyses ?: string ;
9497 /** Analysis key, normally composed from the workflow path and job name. */
9598 analysis_key : string ;
9699 /** Build mode, if specified. */
@@ -287,12 +290,26 @@ export async function createStatusReportBase(
287290 const isSteadyStateDefaultSetupRun =
288291 process . env [ "CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP" ] === "true" ;
289292
293+ // We leave `analyses` empty if we don't have a `config`, so that we don't
294+ // accidentally report only `code-scanning` when we can't tell whether `code-quality`
295+ // is enabled or not.
296+ const analyses : AnalysisKind [ ] = [ ] ;
297+
298+ if ( config !== undefined ) {
299+ analyses . push ( AnalysisKind . CodeScanning ) ;
300+
301+ if ( isCodeQualityEnabled ( config ) ) {
302+ analyses . push ( AnalysisKind . CodeQuality ) ;
303+ }
304+ }
305+
290306 const statusReport : StatusReportBase = {
291307 action_name : actionName ,
292308 action_oid : "unknown" , // TODO decide if it's possible to fill this in
293309 action_ref : actionRef ,
294310 action_started_at : actionStartedAt . toISOString ( ) ,
295311 action_version : getActionVersion ( ) ,
312+ analyses : analyses . join ( "," ) ,
296313 analysis_key,
297314 build_mode : config ?. buildMode ,
298315 commit_oid : commitOid ,
0 commit comments