Skip to content

Commit 89cbccf

Browse files
authored
build(openapi): cache update (#379)
1 parent 072a195 commit 89cbccf

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

docs/codeScanning/uploadSarif.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ There are two places where you can upload code scanning results.
1818
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:
1919

2020
```
21-
gzip -c analysis-data.sarif | base64
21+
gzip -c analysis-data.sarif | base64 -w0
2222
```
2323

24-
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.
24+
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.
2525

2626
The `202 Accepted`, response includes an `id` value.
2727
You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint.

scripts/update-endpoints/generated/endpoints.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11282,7 +11282,7 @@
1128211282
"description": "Response",
1128311283
"examples": [
1128411284
{
11285-
"data": "{\"ref\":\"refs/heads/main\",\"commit_sha\":\"c18c69115654ff0166991962832dc2bd7756e655\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:analyze\",\"environment\":\"{\\\"language\\\":\\\"javascript\\\"}\",\"error\":\"\",\"created_at\":\"2021-01-13T11:55:49Z\",\"results_count\":3,\"rules_count\":67,\"id\":3602840,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\",\"sarif_id\":\"47177e22-5596-11eb-80a1-c1e54ef945c6\",\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"deletable\":true}"
11285+
"data": "{\"ref\":\"refs/heads/main\",\"commit_sha\":\"c18c69115654ff0166991962832dc2bd7756e655\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:analyze\",\"environment\":\"{\\\"language\\\":\\\"javascript\\\"}\",\"error\":\"\",\"created_at\":\"2021-01-13T11:55:49Z\",\"results_count\":3,\"rules_count\":67,\"id\":3602840,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\",\"sarif_id\":\"47177e22-5596-11eb-80a1-c1e54ef945c6\",\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"deletable\":true,\"warning\":\"\"}"
1128611286
}
1128711287
]
1128811288
},
@@ -11747,7 +11747,7 @@
1174711747
"description": "Response",
1174811748
"examples": [
1174911749
{
11750-
"data": "[{\"ref\":\"refs/heads/main\",\"commit_sha\":\"d99612c3e1f2970085cfbaeadf8f010ef69bad83\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:analyze\",\"environment\":\"{\\\"language\\\":\\\"python\\\"}\",\"error\":\"\",\"created_at\":\"2020-08-27T15:05:21Z\",\"results_count\":17,\"rules_count\":49,\"id\":201,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\",\"sarif_id\":\"6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53\",\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"deletable\":true},{\"ref\":\"refs/heads/my-branch\",\"commit_sha\":\"c8cff6510d4d084fb1b4aa13b64b97ca12b07321\",\"analysis_key\":\".github/workflows/shiftleft.yml:build\",\"environment\":\"{}\",\"error\":\"\",\"created_at\":\"2020-08-31T22:46:44Z\",\"results_count\":17,\"rules_count\":32,\"id\":200,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/200\",\"sarif_id\":\"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\",\"tool\":{\"name\":\"Python Security Analysis\",\"guid\":null,\"version\":\"1.2.0\"},\"deletable\":true}]"
11750+
"data": "[{\"ref\":\"refs/heads/main\",\"commit_sha\":\"d99612c3e1f2970085cfbaeadf8f010ef69bad83\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:analyze\",\"environment\":\"{\\\"language\\\":\\\"python\\\"}\",\"error\":\"\",\"created_at\":\"2020-08-27T15:05:21Z\",\"results_count\":17,\"rules_count\":49,\"id\":201,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\",\"sarif_id\":\"6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53\",\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"deletable\":true,\"warning\":\"\"},{\"ref\":\"refs/heads/my-branch\",\"commit_sha\":\"c8cff6510d4d084fb1b4aa13b64b97ca12b07321\",\"analysis_key\":\".github/workflows/shiftleft.yml:build\",\"environment\":\"{}\",\"error\":\"\",\"created_at\":\"2020-08-31T22:46:44Z\",\"results_count\":17,\"rules_count\":32,\"id\":200,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/200\",\"sarif_id\":\"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\",\"tool\":{\"name\":\"Python Security Analysis\",\"guid\":null,\"version\":\"1.2.0\"},\"deletable\":true,\"warning\":\"\"}]"
1175111751
}
1175211752
]
1175311753
},
@@ -11868,7 +11868,7 @@
1186811868
"url": "/repos/{owner}/{repo}/code-scanning/sarifs",
1186911869
"isDeprecated": false,
1187011870
"deprecationDate": null,
11871-
"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).\"",
11871+
"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).\"",
1187211872
"documentationUrl": "https://docs.github.com/rest/reference/code-scanning#upload-an-analysis-as-sarif-data",
1187311873
"previews": [],
1187411874
"headers": [],
@@ -11979,7 +11979,6 @@
1197911979
}
1198011980
],
1198111981
"responses": [
11982-
{ "code": 200, "description": "Response", "examples": null },
1198311982
{
1198411983
"code": 202,
1198511984
"description": "Response",

src/generated/method-types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,10 +2478,10 @@ export type RestEndpointMethods = {
24782478
* 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:
24792479
*
24802480
* ```
2481-
* gzip -c analysis-data.sarif | base64
2481+
* gzip -c analysis-data.sarif | base64 -w0
24822482
* ```
24832483
*
2484-
* 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.
2484+
* 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.
24852485
*
24862486
* The `202 Accepted`, response includes an `id` value.
24872487
* You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint.

0 commit comments

Comments
 (0)