Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions docs/codeScanning/getAlert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Get a code scanning alert
example: octokit.codeScanning.getAlert({ owner, repo, alert_id })
route: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_id}
scope: codeScanning
type: API method
---

# Get a code scanning alert

Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.

The security `alert_id` is found at the end of the security alert's URL. For example, the security alert ID for `https://github.com/Octo-org/octo-repo/security/code-scanning/88` is `88`.

```js
octokit.codeScanning.getAlert({
owner,
repo,
alert_id,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>owner</td><td>yes</td><td>

owner parameter

</td></tr>
<tr><td>repo</td><td>yes</td><td>

repo parameter

</td></tr>
<tr><td>alert_id</td><td>yes</td><td>

alert_id parameter

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/code-scanning/#get-a-code-scanning-alert).
49 changes: 49 additions & 0 deletions docs/codeScanning/listAlertsForRepo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: List code scanning alerts for a repository
example: octokit.codeScanning.listAlertsForRepo({ owner, repo })
route: GET /repos/{owner}/{repo}/code-scanning/alerts
scope: codeScanning
type: API method
---

# List code scanning alerts for a repository

Lists all open code scanning alerts for a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.

```js
octokit.codeScanning.listAlertsForRepo({
owner,
repo,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>owner</td><td>yes</td><td>

owner parameter

</td></tr>
<tr><td>repo</td><td>yes</td><td>

repo parameter

</td></tr>
<tr><td>state</td><td>no</td><td>

Set to `closed` to list only closed code scanning alerts.

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/code-scanning/#list-code-scanning-alerts-for-a-repository).
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"dependencies": {
"@octokit/types": "^2.13.0",
"@octokit/types": "^2.14.0",
"deprecation": "^2.3.1"
},
"devDependencies": {
Expand Down
132 changes: 132 additions & 0 deletions scripts/update-endpoints/generated/endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -20024,6 +20024,138 @@
"responses": [],
"renamed": null
},
{
"name": "List code scanning alerts for a repository",
"scope": "codeScanning",
"id": "listAlertsForRepo",
"method": "GET",
"url": "/repos/{owner}/{repo}/code-scanning/alerts",
"isDeprecated": false,
"isLegacy": false,
"description": "Lists all open code scanning alerts for a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.",
"documentationUrl": "https://developer.github.com/v3/code-scanning/#list-code-scanning-alerts-for-a-repository",
"previews": [],
"headers": [],
"parameters": [
{
"name": "owner",
"description": "owner parameter",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "repo",
"description": "repo parameter",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "state",
"description": "Set to `closed` to list only closed code scanning alerts.",
"in": "QUERY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "[{\"rule_id\":\"js/trivial-conditional\",\"rule_severity\":\"warning\",\"rule_description\":\"Useless conditional\",\"tool\":\"CodeQL\",\"created_at\":\"2020-05-06T12:00:00Z\",\"open\":true,\"closed_by\":null,\"closed_at\":null,\"url\":\"https://api.github.com/repos/Octo-org/octo-repo/code-scanning/alerts/25\",\"html_url\":\"https://github.com/Octo-org/octo-repo/security/code-scanning/25\"},{\"rule_id\":\"js/useless-expression\",\"rule_severity\":\"warning\",\"rule_description\":\"Expression has no effect\",\"tool\":\"CodeQL\",\"created_at\":\"2020-05-06T12:00:00Z\",\"open\":true,\"closed_by\":null,\"closed_at\":null,\"url\":\"https://api.github.com/repos/Octo-org/octo-repo/code-scanning/alerts/88\",\"html_url\":\"https://github.com/Octo-org/octo-repo/security/code-scanning/88\"}]"
}
]
}
],
"renamed": null
},
{
"name": "Get a code scanning alert",
"scope": "codeScanning",
"id": "getAlert",
"method": "GET",
"url": "/repos/{owner}/{repo}/code-scanning/alerts/{alert_id}",
"isDeprecated": false,
"isLegacy": false,
"description": "Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.\n\nThe security `alert_id` is found at the end of the security alert's URL. For example, the security alert ID for `https://github.com/Octo-org/octo-repo/security/code-scanning/88` is `88`.",
"documentationUrl": "https://developer.github.com/v3/code-scanning/#get-a-code-scanning-alert",
"previews": [],
"headers": [],
"parameters": [
{
"name": "owner",
"description": "owner parameter",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "repo",
"description": "repo parameter",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "alert_id",
"description": "alert_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"rule_id\":\"js/useless-expression\",\"rule_severity\":\"warning\",\"rule_description\":\"Expression has no effect\",\"tool\":\"CodeQL\",\"created_at\":\"2020-05-06T12:00:00Z\",\"open\":true,\"closed_by\":null,\"closed_at\":null,\"url\":\"https://api.github.com/repos/Octo-org/octo-repo/code-scanning/alerts/88\",\"html_url\":\"https://github.com/Octo-org/octo-repo/security/code-scanning/88\"}"
}
]
}
],
"renamed": null
},
{
"name": "List collaborators",
"scope": "repos",
Expand Down
4 changes: 4 additions & 0 deletions src/generated/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
{ mediaType: { previews: ["antiope"] } },
],
},
codeScanning: {
getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_id}"],
listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
},
codesOfConduct: {
getAllCodesOfConduct: [
"GET /codes_of_conduct",
Expand Down
28 changes: 28 additions & 0 deletions src/generated/method-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,34 @@ export type RestEndpointMethods = {
endpoint: EndpointInterface<{ url: string }>;
};
};
codeScanning: {
/**
* Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.
*
* The security `alert_id` is found at the end of the security alert's URL. For example, the security alert ID for `https://github.com/Octo-org/octo-repo/security/code-scanning/88` is `88`.
*/
getAlert: {
(
params?: RestEndpointMethodTypes["codeScanning"]["getAlert"]["parameters"]
): Promise<
RestEndpointMethodTypes["codeScanning"]["getAlert"]["response"]
>;
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Lists all open code scanning alerts for a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.
*/
listAlertsForRepo: {
(
params?: RestEndpointMethodTypes["codeScanning"]["listAlertsForRepo"]["parameters"]
): Promise<
RestEndpointMethodTypes["codeScanning"]["listAlertsForRepo"]["response"]
>;
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
};
codesOfConduct: {
getAllCodesOfConduct: {
(
Expand Down
18 changes: 18 additions & 0 deletions src/generated/parameters-and-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,24 @@ export type RestEndpointMethodTypes = {
response: Endpoints["PATCH /repos/:owner/:repo/check-runs/:check_run_id"]["response"];
};
};
codeScanning: {
getAlert: {
parameters: RequestParameters &
Omit<
Endpoints["GET /repos/:owner/:repo/code-scanning/alerts/:alert_id"]["parameters"],
"baseUrl" | "headers" | "mediaType"
>;
response: Endpoints["GET /repos/:owner/:repo/code-scanning/alerts/:alert_id"]["response"];
};
listAlertsForRepo: {
parameters: RequestParameters &
Omit<
Endpoints["GET /repos/:owner/:repo/code-scanning/alerts"]["parameters"],
"baseUrl" | "headers" | "mediaType"
>;
response: Endpoints["GET /repos/:owner/:repo/code-scanning/alerts"]["response"];
};
};
codesOfConduct: {
getAllCodesOfConduct: {
parameters: RequestParameters &
Expand Down