Skip to content

Commit 90472a9

Browse files
authored
fix: description and response data types updates for code-scanning endpoints (#75)
1 parent 35da498 commit 90472a9

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

cache/openapi-schema.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"openapi": "3.0.3",
33
"info": {
4-
"version": "2.16.2",
4+
"version": "2.16.3",
55
"title": "GitHub's official OpenAPI spec + Octokit extension",
66
"description": "OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs",
77
"license": { "name": "MIT", "url": "https://spdx.org/licenses/MIT" },
@@ -18503,7 +18503,7 @@
1850318503
"/repos/{owner}/{repo}/code-scanning/sarifs": {
1850418504
"post": {
1850518505
"summary": "Upload an analysis as SARIF data",
18506-
"description": "Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint.\n\nThere are two places where you can upload code scanning results.\n - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see \"[Triaging code scanning alerts in pull requests](/github/finding-security-vulnerabilities-and-errors-in-your-code/triaging-code-scanning-alerts-in-pull-requests).\"\n - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see \"[Managing code scanning alerts for your repository](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository).\"\n\nYou must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:\n\n```\ngzip -c analysis-data.sarif | base64\n```\n\nSARIF upload supports a maximum of 1000 results per analysis run. Any results over this limit are ignored. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.\n\nThe `202 Accepted`, response includes an `id` value.\nYou can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint.\nFor more information, see \"[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload).\"",
18506+
"description": "Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint.\n\nThere are two places where you can upload code scanning results.\n - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see \"[Triaging code scanning alerts in pull requests](/github/finding-security-vulnerabilities-and-errors-in-your-code/triaging-code-scanning-alerts-in-pull-requests).\"\n - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see \"[Managing code scanning alerts for your repository](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository).\"\n\nYou must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:\n\n```\ngzip -c analysis-data.sarif | base64 -w0\n```\n\nSARIF upload supports a maximum of 5000 results per analysis run. Any results over this limit are ignored and any SARIF uploads with more than 25,000 results are rejected. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.\n\nThe `202 Accepted`, response includes an `id` value.\nYou can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint.\nFor more information, see \"[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload).\"",
1850718507
"operationId": "code-scanning/upload-sarif",
1850818508
"tags": ["code-scanning"],
1850918509
"externalDocs": {
@@ -18549,10 +18549,6 @@
1854918549
}
1855018550
},
1855118551
"responses": {
18552-
"200": {
18553-
"description": "Response",
18554-
"content": { "application/json": { "schema": {} } }
18555-
},
1855618552
"202": {
1855718553
"description": "Response",
1855818554
"content": {
@@ -46782,7 +46778,12 @@
4678246778
"tool": {
4678346779
"$ref": "#/components/schemas/code-scanning-analysis-tool"
4678446780
},
46785-
"deletable": { "type": "boolean" }
46781+
"deletable": { "type": "boolean" },
46782+
"warning": {
46783+
"type": "string",
46784+
"description": "Warning generated when processing the analysis",
46785+
"example": "123 results were ignored"
46786+
}
4678646787
},
4678746788
"required": [
4678846789
"ref",
@@ -46797,7 +46798,8 @@
4679746798
"url",
4679846799
"sarif_id",
4679946800
"tool",
46800-
"deletable"
46801+
"deletable",
46802+
"warning"
4680146803
]
4680246804
},
4680346805
"code-scanning-analysis-deletion": {
@@ -60662,7 +60664,8 @@
6066260664
"url": "https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201",
6066360665
"sarif_id": "6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53",
6066460666
"tool": { "name": "CodeQL", "guid": null, "version": "2.4.0" },
60665-
"deletable": true
60667+
"deletable": true,
60668+
"warning": ""
6066660669
},
6066760670
{
6066860671
"ref": "refs/heads/my-branch",
@@ -60681,7 +60684,8 @@
6068160684
"guid": null,
6068260685
"version": "1.2.0"
6068360686
},
60684-
"deletable": true
60687+
"deletable": true,
60688+
"warning": ""
6068560689
}
6068660690
]
6068760691
},
@@ -60700,7 +60704,8 @@
6070060704
"url": "https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201",
6070160705
"sarif_id": "47177e22-5596-11eb-80a1-c1e54ef945c6",
6070260706
"tool": { "name": "CodeQL", "guid": null, "version": "2.4.0" },
60703-
"deletable": true
60707+
"deletable": true,
60708+
"warning": ""
6070460709
}
6070560710
},
6070660711
"code-scanning-analysis-deletion": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
]
5454
},
5555
"octokit": {
56-
"openapi-version": "2.16.2"
56+
"openapi-version": "2.16.3"
5757
},
5858
"@pika/pack": {
5959
"pipeline": [

src/generated/types.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2611,10 +2611,10 @@ export interface paths {
26112611
* You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:
26122612
*
26132613
* ```
2614-
* gzip -c analysis-data.sarif | base64
2614+
* gzip -c analysis-data.sarif | base64 -w0
26152615
* ```
26162616
*
2617-
* SARIF upload supports a maximum of 1000 results per analysis run. Any results over this limit are ignored. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.
2617+
* SARIF upload supports a maximum of 5000 results per analysis run. Any results over this limit are ignored and any SARIF uploads with more than 25,000 results are rejected. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.
26182618
*
26192619
* The `202 Accepted`, response includes an `id` value.
26202620
* You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint.
@@ -7925,6 +7925,8 @@ export interface components {
79257925
sarif_id: components["schemas"]["code-scanning-analysis-sarif-id"];
79267926
tool: components["schemas"]["code-scanning-analysis-tool"];
79277927
deletable: boolean;
7928+
/** Warning generated when processing the analysis */
7929+
warning: string;
79287930
};
79297931
/** Successful deletion of a code scanning analysis */
79307932
"code-scanning-analysis-deletion": {
@@ -20786,10 +20788,10 @@ export interface operations {
2078620788
* You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:
2078720789
*
2078820790
* ```
20789-
* gzip -c analysis-data.sarif | base64
20791+
* gzip -c analysis-data.sarif | base64 -w0
2079020792
* ```
2079120793
*
20792-
* SARIF upload supports a maximum of 1000 results per analysis run. Any results over this limit are ignored. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.
20794+
* SARIF upload supports a maximum of 5000 results per analysis run. Any results over this limit are ignored and any SARIF uploads with more than 25,000 results are rejected. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.
2079320795
*
2079420796
* The `202 Accepted`, response includes an `id` value.
2079520797
* You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint.
@@ -20803,12 +20805,6 @@ export interface operations {
2080320805
};
2080420806
};
2080520807
responses: {
20806-
/** Response */
20807-
200: {
20808-
content: {
20809-
"application/json": { [key: string]: any };
20810-
};
20811-
};
2081220808
/** Response */
2081320809
202: {
2081420810
content: {

0 commit comments

Comments
 (0)