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
86 changes: 86 additions & 0 deletions docs/codeScanning/listAlertsForEnterprise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
name: List code scanning alerts for an enterprise
example: octokit.rest.codeScanning.listAlertsForEnterprise({ enterprise })
route: GET /enterprises/{enterprise}/code-scanning/alerts
scope: codeScanning
type: API method
---

# List code scanning alerts for an enterprise

Lists code scanning alerts for the default branch for all eligible repositories in an enterprise. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."

To use this endpoint, you must be a member of the enterprise,
and you must use an access token with the `repo` scope or `security_events` scope.

```js
octokit.rest.codeScanning.listAlertsForEnterprise({
enterprise,
});
```

## Parameters

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

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

</td></tr>
<tr><td>tool_name</td><td>no</td><td>

The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both.

</td></tr>
<tr><td>tool_guid</td><td>no</td><td>

The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both.

</td></tr>
<tr><td>before</td><td>no</td><td>

A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor.

</td></tr>
<tr><td>after</td><td>no</td><td>

A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor.

</td></tr>
<tr><td>page</td><td>no</td><td>

Page number of the results to fetch.

</td></tr>
<tr><td>per_page</td><td>no</td><td>

The number of results per page (max 100).

</td></tr>
<tr><td>direction</td><td>no</td><td>

The direction to sort the results by.

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

If specified, only code scanning alerts with this state will be returned.

</td></tr>
<tr><td>sort</td><td>no</td><td>

The property by which to sort the results.

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

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/code-scanning#list-code-scanning-alerts-for-an-enterprise).
2 changes: 2 additions & 0 deletions docs/projects/createForAuthenticatedUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ type: API method

# Create a user project

Creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.

```js
octokit.rest.projects.createForAuthenticatedUser({
name,
Expand Down
2 changes: 1 addition & 1 deletion docs/projects/createForOrg.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type: API method

# Create an organization project

Creates an organization project board. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
Creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.

```js
octokit.rest.projects.createForOrg({
Expand Down
2 changes: 1 addition & 1 deletion docs/projects/createForRepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type: API method

# Create a repository project

Creates a repository project board. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
Creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.

```js
octokit.rest.projects.createForRepo({
Expand Down
2 changes: 1 addition & 1 deletion docs/repos/createDispatchEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ A custom webhook event name. Must be 100 characters or fewer.
</td></tr>
<tr><td>client_payload</td><td>no</td><td>

JSON payload with extra information about the webhook event that your action or worklow may use.
JSON payload with extra information about the webhook event that your action or workflow may use.

</td></tr>
<tr><td>client_payload.*</td><td>no</td><td>
Expand Down
30 changes: 15 additions & 15 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": "^6.40.0",
"@octokit/types": "^6.41.0",
"deprecation": "^2.3.1"
},
"devDependencies": {
Expand Down
173 changes: 169 additions & 4 deletions scripts/update-endpoints/generated/endpoints.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/generated/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
listAlertInstances: [
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
],
listAlertsForEnterprise: [
"GET /enterprises/{enterprise}/code-scanning/alerts",
],
listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
listAlertsInstances: [
Expand Down
23 changes: 20 additions & 3 deletions src/generated/method-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2980,6 +2980,21 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Lists code scanning alerts for the default branch for all eligible repositories in an enterprise. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
*
* To use this endpoint, you must be a member of the enterprise,
* and you must use an access token with the `repo` scope or `security_events` scope.
*/
listAlertsForEnterprise: {
(
params?: RestEndpointMethodTypes["codeScanning"]["listAlertsForEnterprise"]["parameters"]
): Promise<
RestEndpointMethodTypes["codeScanning"]["listAlertsForEnterprise"]["response"]
>;
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
*
Expand Down Expand Up @@ -6788,7 +6803,9 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};

/**
* Creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
*/
createForAuthenticatedUser: {
(
params?: RestEndpointMethodTypes["projects"]["createForAuthenticatedUser"]["parameters"]
Expand All @@ -6799,7 +6816,7 @@ export type RestEndpointMethods = {
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Creates an organization project board. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
* Creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
*/
createForOrg: {
(
Expand All @@ -6811,7 +6828,7 @@ export type RestEndpointMethods = {
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Creates a repository project board. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
* Creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
*/
createForRepo: {
(
Expand Down
8 changes: 8 additions & 0 deletions src/generated/parameters-and-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,14 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"]["response"];
};
listAlertsForEnterprise: {
parameters: RequestParameters &
Omit<
Endpoints["GET /enterprises/{enterprise}/code-scanning/alerts"]["parameters"],
"baseUrl" | "headers" | "mediaType"
>;
response: Endpoints["GET /enterprises/{enterprise}/code-scanning/alerts"]["response"];
};
listAlertsForOrg: {
parameters: RequestParameters &
Omit<
Expand Down