-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: `octokit.secretScanning.{getAlert,listAlertsForRepo,updateAlert…
…}` (#298) Co-authored-by: Gregor Martynus <[email protected]>
- Loading branch information
1 parent
788c8a8
commit e01de33
Showing
13 changed files
with
539 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
name: Get a secret scanning alert | ||
example: octokit.secretScanning.getAlert({ owner, repo, alert_number }) | ||
route: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} | ||
scope: secretScanning | ||
type: API method | ||
--- | ||
|
||
# Get a secret scanning alert | ||
|
||
Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. | ||
|
||
GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. | ||
|
||
```js | ||
octokit.secretScanning.getAlert({ | ||
owner, | ||
repo, | ||
alert_number, | ||
}); | ||
``` | ||
|
||
## Parameters | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>name</th> | ||
<th>required</th> | ||
<th>description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr><td>owner</td><td>yes</td><td> | ||
|
||
</td></tr> | ||
<tr><td>repo</td><td>yes</td><td> | ||
|
||
</td></tr> | ||
<tr><td>alert_number</td><td>yes</td><td> | ||
|
||
The security alert number, found at the end of the security alert's URL. | ||
|
||
</td></tr> | ||
</tbody> | ||
</table> | ||
|
||
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/secret-scanning#get-a-secret-scanning-alert). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
name: List secret scanning alerts for a repository | ||
example: octokit.secretScanning.listAlertsForRepo({ owner, repo }) | ||
route: GET /repos/{owner}/{repo}/secret-scanning/alerts | ||
scope: secretScanning | ||
type: API method | ||
--- | ||
|
||
# List secret scanning alerts for a repository | ||
|
||
Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. | ||
|
||
GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. | ||
|
||
```js | ||
octokit.secretScanning.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> | ||
|
||
</td></tr> | ||
<tr><td>repo</td><td>yes</td><td> | ||
|
||
</td></tr> | ||
<tr><td>state</td><td>no</td><td> | ||
|
||
Set to `open` or `resolved` to only list secret scanning alerts in a specific state. | ||
|
||
</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> | ||
|
||
Results per page (max 100) | ||
|
||
</td></tr> | ||
</tbody> | ||
</table> | ||
|
||
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/secret-scanning#list-secret-scanning-alerts-for-a-repository). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
name: Update a secret scanning alert | ||
example: octokit.secretScanning.updateAlert({ owner, repo, alert_number, state }) | ||
route: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} | ||
scope: secretScanning | ||
type: API method | ||
--- | ||
|
||
# Update a secret scanning alert | ||
|
||
Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. | ||
|
||
GitHub Apps must have the `secret_scanning_alerts` write permission to use this endpoint. | ||
|
||
```js | ||
octokit.secretScanning.updateAlert({ | ||
owner, | ||
repo, | ||
alert_number, | ||
state, | ||
}); | ||
``` | ||
|
||
## Parameters | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>name</th> | ||
<th>required</th> | ||
<th>description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr><td>owner</td><td>yes</td><td> | ||
|
||
</td></tr> | ||
<tr><td>repo</td><td>yes</td><td> | ||
|
||
</td></tr> | ||
<tr><td>alert_number</td><td>yes</td><td> | ||
|
||
The security alert number, found at the end of the security alert's URL. | ||
|
||
</td></tr> | ||
<tr><td>state</td><td>yes</td><td> | ||
|
||
Sets the state of the secret scanning alert. Can be either `open` or `resolved`. You must provide `resolution` when you set the state to `resolved`. | ||
|
||
</td></tr> | ||
<tr><td>resolution</td><td>no</td><td> | ||
|
||
**Required when the `state` is `resolved`.** The reason for resolving the alert. Can be one of `false_positive`, `wont_fix`, `revoked`, or `used_in_tests`. | ||
|
||
</td></tr> | ||
</tbody> | ||
</table> | ||
|
||
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/secret-scanning#update-a-secret-scanning-alert). |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.