mirror of
https://github.com/github/codeql-action.git
synced 2026-10-21 02:01:27 +00:00
Use ActionConfig in diagnostics.ts
This commit is contained in:
@@ -3,7 +3,7 @@ import path from "path";
|
||||
|
||||
import type { ActionState } from "./action-common";
|
||||
import { getTemporaryDirectory } from "./actions-util";
|
||||
import type { Config } from "./config-utils";
|
||||
import type { ActionConfig } from "./config/action-config";
|
||||
import { Language } from "./languages";
|
||||
import { getActionsLogger, type Logger } from "./logging";
|
||||
import {
|
||||
@@ -160,7 +160,7 @@ export function getDiagnosticsPath(basePath: string, language?: Language) {
|
||||
* @param diagnostic The diagnostic message to add to the database.
|
||||
*/
|
||||
export function addDiagnostic(
|
||||
config: Config,
|
||||
config: ActionConfig<"dbLocation" | "tempDir">,
|
||||
language: Language,
|
||||
diagnostic: DiagnosticMessage,
|
||||
logger: Logger = getActionsLogger(),
|
||||
@@ -185,7 +185,7 @@ export function addDiagnostic(
|
||||
|
||||
/** Adds a diagnostic that is not specific to any language. */
|
||||
export function addNoLanguageDiagnostic(
|
||||
config: Config | undefined,
|
||||
config: ActionConfig<"languages" | "dbLocation" | "tempDir"> | undefined,
|
||||
diagnostic: DiagnosticMessage,
|
||||
logger: Logger = getActionsLogger(),
|
||||
) {
|
||||
@@ -268,7 +268,7 @@ function writeDiagnosticFile(
|
||||
|
||||
/** Gets the path where diagnostics for {@link language} should be stored in the database. */
|
||||
export function getDatabaseDiagnosticsPath(
|
||||
config: Config,
|
||||
config: ActionConfig<"dbLocation">,
|
||||
language: Language | undefined,
|
||||
) {
|
||||
return getDiagnosticsPath(config.dbLocation, language);
|
||||
@@ -283,7 +283,7 @@ export function getDatabaseDiagnosticsPath(
|
||||
*/
|
||||
function writeDiagnostic(
|
||||
action: ActionState<["Logger"]>,
|
||||
config: Config,
|
||||
config: ActionConfig<"dbLocation">,
|
||||
language: Language | undefined,
|
||||
diagnostic: DiagnosticMessage,
|
||||
) {
|
||||
@@ -317,7 +317,7 @@ export function logTemporaryDiagnostics(action: ActionState<["Logger"]>) {
|
||||
/** Relocates all temporary diagnostics to the respective databases. */
|
||||
export function flushDiagnostics(
|
||||
action: ActionState<["Logger"]>,
|
||||
config: Config,
|
||||
config: ActionConfig<"dbLocation" | "languages">,
|
||||
) {
|
||||
const diagnosticsCount = temporaryDiagnostics.length;
|
||||
action.logger.debug(
|
||||
|
||||
Reference in New Issue
Block a user