/** * SARIF Upload - GitHub Code Scanning Integration * * Uploads SARIF files to GitHub Code Scanning API. * * @module action/sarif-upload */ import type { AggregatedScanResult } from "../scanners/types.js"; import type { GitHubContext } from "./types.js"; /** * SARIF 2.1.0 structure */ interface SarifReport { $schema: string; version: string; runs: SarifRun[]; } interface SarifRun { tool: { driver: { name: string; version: string; informationUri: string; rules: SarifRule[]; }; }; results: SarifResult[]; automationDetails?: { id: string; }; } interface SarifRule { id: string; name: string; shortDescription: { text: string; }; fullDescription?: { text: string; }; help?: { text: string; markdown?: string; }; defaultConfiguration: { level: "none" | "note" | "warning" | "error"; }; properties?: { tags?: string[]; precision?: string; "security-severity"?: string; }; } interface SarifResult { ruleId: string; level: "none" | "note" | "warning" | "error"; message: { text: string; }; locations: Array<{ physicalLocation: { artifactLocation: { uri: string; uriBaseId: string; }; region: { startLine: number; startColumn?: number; endLine?: number; endColumn?: number; }; }; }>; fingerprints?: { primaryLocationLineHash?: string; }; partialFingerprints?: Record; } /** * Convert aggregated scan results to SARIF format */ export declare function convertToSarif(scanResult: AggregatedScanResult): SarifReport; /** * Write SARIF file to disk */ export declare function writeSarifFile(sarif: SarifReport, outputPath: string): Promise; /** * Upload SARIF to GitHub Code Scanning API * * Note: This requires the code-scanning: write permission */ export declare function uploadSarifToGitHub(octokit: any, context: GitHubContext, sarifPath: string): Promise<{ id: string; }>; /** * Generate SARIF file path */ export declare function getSarifFilePath(workingDirectory: string): string; /** * Check if SARIF upload is supported (requires write permission) */ export declare function checkSarifUploadSupported(octokit: any, context: GitHubContext): Promise; export {}; //# sourceMappingURL=sarif-upload.d.ts.map