Skip to content

Commit cb8f28f

Browse files
committed
Add kind property to AnalysisConfig and documentation
1 parent 0162708 commit cb8f28f

5 files changed

Lines changed: 17 additions & 0 deletions

File tree

lib/analyze-action.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-lib.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-sarif-action.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyses.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,22 @@ export enum SARIF_UPLOAD_ENDPOINT {
5050

5151
// Represents configurations for different analysis kinds.
5252
export interface AnalysisConfig {
53+
/** The analysis kind the configuration is for. */
54+
kind: AnalysisKind;
55+
/** A display friendly name for logs. */
5356
name: string;
57+
/** The API endpoint to upload SARIF files to. */
5458
target: SARIF_UPLOAD_ENDPOINT;
59+
/** A predicate on filenames to decide whether a SARIF file
60+
* belongs to this kind of analysis. */
5561
sarifPredicate: (name: string) => boolean;
62+
/** A prefix for environment variables used to track the uniqueness of SARIF uploads. */
5663
sentinelPrefix: string;
5764
}
5865

5966
// Represents the Code Scanning analysis configuration.
6067
export const CodeScanning: AnalysisConfig = {
68+
kind: AnalysisKind.CodeScanning,
6169
name: "code scanning",
6270
target: SARIF_UPLOAD_ENDPOINT.CODE_SCANNING,
6371
sarifPredicate: (name) =>
@@ -67,6 +75,7 @@ export const CodeScanning: AnalysisConfig = {
6775

6876
// Represents the Code Quality analysis configuration.
6977
export const CodeQuality: AnalysisConfig = {
78+
kind: AnalysisKind.CodeQuality,
7079
name: "code quality",
7180
target: SARIF_UPLOAD_ENDPOINT.CODE_QUALITY,
7281
sarifPredicate: (name) => name.endsWith(".quality.sarif"),

0 commit comments

Comments
 (0)