Skip to content

Commit 5c96b6e

Browse files
committed
Add JSDoc comments to upload-lib types
1 parent d6ea670 commit 5c96b6e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/upload-lib/types.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,45 @@
1+
/**
2+
* Represents the minimum, common payload for SARIF upload endpoints that we support.
3+
*/
14
export interface BasePayload {
5+
/** The gzipped contents of a SARIF file. */
26
sarif: string;
37
}
48

9+
/**
10+
* Represents the payload expected for Code Scanning and Code Quality SARIF uploads.
11+
*/
512
export interface UploadPayload extends BasePayload {
13+
/** The SHA of the commit that was analysed. */
614
commit_oid: string;
15+
/** The ref that was analysed. */
716
ref: string;
17+
/** The analysis key that identifies the analysis. */
818
analysis_key?: string;
19+
/** The name of the analysis. */
920
analysis_name?: string;
21+
/** The ID of the workflow run that performed the analysis. */
1022
workflow_run_id: number;
23+
/** The attempt number. */
1124
workflow_run_attempt: number;
25+
/** The URI where the repository was checked out. */
1226
checkout_uri: string;
27+
/** The matrix value. */
1328
environment?: string;
29+
/** A string representation of when the analysis was started. */
1430
started_at?: string;
31+
/** The names of the tools that performed the analysis. */
1532
tool_names: string[];
33+
/** For a pull request, the ref of the base the PR is targeting. */
1634
base_ref?: string;
35+
/** For a pull request, the commit SHA of the merge base. */
1736
base_sha?: string;
1837
}
1938

39+
/**
40+
* Represents the payload expected for Code Scanning Risk Assessment SARIF uploads.
41+
*/
2042
export interface AssessmentPayload extends BasePayload {
43+
/** The ID of the assessment for which the SARIF is for. */
2144
assessment_id: number;
2245
}

0 commit comments

Comments
 (0)