mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 16:58:47 +00:00
Refactor existing telemetry diagnostics to use makeTelemetryDiagnostic
Refactored bundle-download-telemetry and zstd-availability diagnostics in init-action.ts to use the new makeTelemetryDiagnostic helper function. Also added guard for empty languages array in logGitVersionTelemetry. Co-authored-by: henrymercer <14129055+henrymercer@users.noreply.github.com>
This commit is contained in:
+3
-1
@@ -88,9 +88,11 @@ export async function logGitVersionTelemetry(
|
||||
logger: Logger,
|
||||
): Promise<void> {
|
||||
const version = await getGitVersion(logger);
|
||||
if (version !== undefined) {
|
||||
if (version !== undefined && config.languages.length > 0) {
|
||||
addDiagnostic(
|
||||
config,
|
||||
// Arbitrarily choose the first language. We could also choose all languages, but that
|
||||
// increases the risk of misinterpreting the data.
|
||||
config.languages[0],
|
||||
makeTelemetryDiagnostic(
|
||||
"codeql-action/git-version-telemetry",
|
||||
|
||||
Reference in New Issue
Block a user