-
-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into code-completion
- Loading branch information
Showing
45 changed files
with
923 additions
and
114 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Enterprise / Secret Scanning API | ||
[Back to the "Enterprise API"](../../enterprise.md) | [Back to the navigation](../../README.md) | ||
|
||
# List secret-scanning alerts for an Enterprise | ||
|
||
https://docs.github.com/en/[email protected]/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise | ||
|
||
```php | ||
$alerts = $client->api('enterprise')->secretScanning()->alerts('KnpLabs'); | ||
``` |
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,10 @@ | ||
## Organization / Secret Scanning API | ||
[Back to the "Organization API"](../../organization.md) | [Back to the navigation](../../README.md) | ||
|
||
# List secret-scanning alerts for an Organization | ||
|
||
https://docs.github.com/en/[email protected]/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization | ||
|
||
```php | ||
$alerts = $client->api('organization')->secretScanning()->alerts('KnpLabs'); | ||
``` |
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,37 @@ | ||
## Repository / Secret Scanning API | ||
[Back to the "Repos API"](../../repos.md) | [Back to the navigation](../../README.md) | ||
|
||
# List secret-scanning alerts for a repository | ||
|
||
https://docs.github.com/en/[email protected]/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository | ||
|
||
```php | ||
$alerts = $client->api('repos')->secretScanning()->alerts('KnpLabs', 'php-github-api'); | ||
``` | ||
|
||
# Get a secret-scanning alert | ||
|
||
https://docs.github.com/en/[email protected]/rest/secret-scanning#get-a-secret-scanning-alert | ||
|
||
```php | ||
$alert = $client->api('repos')->secretScanning()->getAlert('KnpLabs', 'php-github-api', $alertNumber); | ||
``` | ||
|
||
# Update a secret-scanning alert | ||
|
||
https://docs.github.com/en/[email protected]/rest/secret-scanning#update-a-secret-scanning-alert | ||
|
||
```php | ||
$client->api('repos')->secretScanning()->updateAlert('KnpLabs', 'php-github-api', $alertNumber, [ | ||
'state' => 'resolved', | ||
'resolution' => 'wont-fix' | ||
]); | ||
``` | ||
|
||
# List Locations for a secret-scanning alert | ||
|
||
https://docs.github.com/en/[email protected]/rest/secret-scanning#list-locations-for-a-secret-scanning-alert | ||
|
||
```php | ||
$locations = $client->api('repos')->secretScanning()->locations('KnpLabs', 'php-github-api', $alertNumber); | ||
``` |
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,79 @@ | ||
## User / Migrations API | ||
[Back to the "Users API"](../../users.md) | [Back to the navigation](../../README.md) | ||
|
||
# List user migrations | ||
|
||
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#list-user-migrations | ||
|
||
```php | ||
$api = $github->api('user')->migration(); | ||
$paginator = new Github\ResultPager($github); | ||
$parameters = []; | ||
$migrations = $paginator->fetchAll($api, 'list', $parameters); | ||
|
||
do { | ||
foreach ($migrations as $migration) { | ||
// do something | ||
} | ||
$migrations = $paginator->fetchNext(); | ||
} | ||
while($paginator->hasNext()); | ||
``` | ||
|
||
# Start a User Migration | ||
|
||
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#start-a-user-migration | ||
|
||
```php | ||
$client->users()->migration()->start([ | ||
'repositories' => [ | ||
'KnpLabs/php-github-api' | ||
], | ||
'lock_repositories' => true, | ||
'exclude_metadata' => false, | ||
'exclude_git_data' => false, | ||
'exclude_attachments' => true, | ||
'exclude_releases' => false, | ||
'exclude_owner_projects' => true, | ||
'org_metadata_only' => false, | ||
'exclude' => [ | ||
'Exclude attributes from the API response to improve performance' | ||
] | ||
]); | ||
``` | ||
|
||
# Get a User Migration Status | ||
|
||
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#get-a-user-migration-status | ||
|
||
```php | ||
$status = $client->user()->migration()->status(12, [ | ||
'exclude' => [ | ||
'exclude attributes' | ||
] | ||
]); | ||
``` | ||
|
||
# Delete a User Migration Archive | ||
|
||
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#delete-a-user-migration-archive | ||
|
||
```php | ||
$client->user()->migration()->deleteArchive(12); | ||
``` | ||
|
||
# Unlock a User Repository | ||
|
||
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#unlock-a-user-repository | ||
|
||
```php | ||
$client->user()->migration()->unlockRepo(12, 'php-github-api'); | ||
``` | ||
|
||
# List repositories for a User Migration | ||
|
||
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#list-repositories-for-a-user-migration | ||
|
||
```php | ||
$repos = $client->user()->migration()->repos(2); | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Github\Api\Enterprise; | ||
|
||
use Github\Api\AbstractApi; | ||
|
||
class SecretScanning extends AbstractApi | ||
{ | ||
/** | ||
* @link https://docs.github.com/en/[email protected]/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise | ||
* | ||
* @param string $enterprise | ||
* @param array $params | ||
* | ||
* @return array|string | ||
*/ | ||
public function alerts(string $enterprise, array $params = []) | ||
{ | ||
return $this->get('/enterprises/'.rawurlencode($enterprise).'/secret-scanning/alerts', $params); | ||
} | ||
} |
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
Oops, something went wrong.