-
-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR was merged into the 2.x branch. Discussion ---------- - [x] Artifacts - [x] Secrets - [x] Self-hosted runners - [x] Workflows - [x] Workflow jobs - [x] Workflow runs Documentation: https://developer.github.com/v3/actions/ Commits ------- 703955e repo: added actions
- Loading branch information
Showing
24 changed files
with
1,967 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
## Organization / Secrets API | ||
[Back to the "Organization API"](../organization.md) | [Back to the navigation](../README.md) | ||
|
||
### List organization secrets | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-organization-secrets | ||
|
||
```php | ||
$secrets = $client->organization()->secrets()->all('KnpLabs'); | ||
``` | ||
|
||
### Get an organization secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-an-organization-secret | ||
|
||
```php | ||
$secret = $client->organization()->secrets()->show('KnpLabs', $secretName); | ||
``` | ||
|
||
### Create an organization secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#create-or-update-an-organization-secret | ||
|
||
```php | ||
$client->organization()->secrets()->create('KnpLabs', $secretName, [ | ||
'encrypted_value' => $encryptedValue, | ||
'visibility' => $visibility, | ||
'selected_repository_ids' => $selectedRepositoryIds, | ||
]); | ||
``` | ||
|
||
### Update an organization secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#create-or-update-an-organization-secret | ||
|
||
```php | ||
$client->organization()->secrets()->update('KnpLabs', $secretName, [ | ||
'key_id' => 'keyId', | ||
'encrypted_value' => 'encryptedValue', | ||
'visibility' => 'private', | ||
]); | ||
``` | ||
|
||
### Delete an organization secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#delete-an-organization-secret | ||
|
||
```php | ||
$client->organization()->secrets()->remove('KnpLabs', $secretName); | ||
``` | ||
|
||
### List selected repositories for organization secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-selected-repositories-for-an-organization-secret | ||
|
||
```php | ||
$client->organization()->secrets()->selectedRepositories('KnpLabs', $secretName); | ||
``` | ||
|
||
### Set selected repositories for an organization secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#set-selected-repositories-for-an-organization-secret | ||
|
||
```php | ||
$client->organization()->secrets()->setSelectedRepositories('KnpLabs', 'secretName', [ | ||
'selected_repository_ids' => [1, 2, 3], | ||
]); | ||
``` | ||
|
||
### Remove selected repository from an organization secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#remove-selected-repository-from-an-organization-secret | ||
|
||
```php | ||
$client->organization()->secrets()->addSecret('KnpLabs', $repositoryId, $secretName); | ||
``` | ||
|
||
### Get an organization public key | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-an-organization-public-key | ||
|
||
```php | ||
$client->organization()->secrets()->publicKey('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,44 @@ | ||
## Repo / Artifacts API | ||
[Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) | ||
|
||
### List artifacts for a repository | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-artifacts-for-a-repository | ||
|
||
```php | ||
$artifacts = $client->api('repo')->artifacts()->all('KnpLabs'); | ||
``` | ||
|
||
### List workflow run artifacts | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-workflow-run-artifacts | ||
|
||
```php | ||
$runArtifacts = $client->api('repo')->artifacts()->runArtifacts('KnpLabs', 'php-github-api', $runId); | ||
``` | ||
|
||
### Get an artifact | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-an-artifact | ||
|
||
```php | ||
$artifact = $client->api('repo')->artifacts()->show('KnpLabs', 'php-github-api', $artifactId); | ||
``` | ||
|
||
### Delete an artifact | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#delete-an-artifact | ||
|
||
```php | ||
$client->api('repo')->artifacts()->delete('KnpLabs', 'php-github-api', $artifactId); | ||
``` | ||
|
||
|
||
### Download an artifact | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#download-an-artifact | ||
|
||
```php | ||
$artifactFile = $client->api('repo')->artifacts()->download('KnpLabs', 'php-github-api', $artifactId, $format = 'zip'); | ||
file_put_contents($artifactId.'.'.$format, $artifactFile); | ||
``` |
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,54 @@ | ||
## Repo / Secrets API | ||
[Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) | ||
|
||
### List repository secrets | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-repository-secrets | ||
|
||
```php | ||
$secrets = $client->api('repo')->secrets()->all('KnpLabs', 'php-github-api'); | ||
``` | ||
|
||
### Get a repository secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-a-repository-secret | ||
|
||
```php | ||
$secret = $client->api('repo')->secrets()->show('KnpLabs', 'php-github-api', $secretName); | ||
``` | ||
|
||
### Create a repository secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#create-or-update-a-repository-secret | ||
|
||
```php | ||
$client->api('repo')->secrets()->create('KnpLabs', 'php-github-api', $secretName, [ | ||
'encrypted_value' => $encryptedValue, | ||
]); $client->api('repo')->secrets()->all(); | ||
``` | ||
|
||
### Update a repository secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#create-or-update-a-repository-secret | ||
|
||
```php | ||
$client->api('repo')->secrets()->update('KnpLabs', 'php-github-api', $secretName, [ | ||
'key_id' => $keyId, 'encrypted_value' => $encryptedValue, | ||
]); | ||
``` | ||
|
||
### Delete a repository secret | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#delete-a-repository-secret | ||
|
||
```php | ||
$client->api('repo')->secrets()->remove('KnpLabs', 'php-github-api', $secretName); | ||
``` | ||
|
||
### Get a repository public key | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-a-repository-public-key | ||
|
||
```php | ||
$publicKey = $client->api('repo')->secrets()->publicKey('KnpLabs', 'php-github-api'); | ||
``` |
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,35 @@ | ||
## Repo / Self Hosted Runners API | ||
[Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) | ||
|
||
# List self-hosted runners for a repository | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-self-hosted-runners-for-a-repository | ||
|
||
```php | ||
$runners = $client->api('repo')->selfHostedRunners()->all('KnpLabs', 'php-github-api'); | ||
``` | ||
|
||
# Get a self-hosted runner for a repository | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-a-self-hosted-runner-for-a-repository | ||
|
||
```php | ||
$runner = $client->api('repo')->selfHostedRunners()->show('KnpLabs', 'php-github-api', $runnerId); | ||
``` | ||
|
||
# Delete a self-hosted runner from a repository | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository | ||
|
||
```php | ||
$client->api('repo')->selfHostedRunners()->remove('KnpLabs', 'php-github-api', $runnerId); | ||
``` | ||
|
||
# List runner applications for a repository | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-runner-applications-for-a-repository | ||
|
||
```php | ||
$applications = $client->api('repo')->selfHostedRunners()->applications('KnpLabs', 'php-github-api'); | ||
``` | ||
|
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,27 @@ | ||
## Repo / Workflow Jobs API | ||
[Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) | ||
|
||
### List jobs for a workflow run | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-jobs-for-a-workflow-run | ||
|
||
```php | ||
$client->api('repo')->workflowJobs()->all('KnpLabs', 'php-github-api', $runId); | ||
``` | ||
|
||
### Get a job for a workflow run | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-a-job-for-a-workflow-run | ||
|
||
```php | ||
$job = $client->api('repo')->workflowJobs()->all('KnpLabs', 'php-github-api', $jobId); | ||
``` | ||
|
||
### Download job logs for a workflow run | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#download-job-logs-for-a-workflow-run | ||
|
||
```php | ||
$jobLogs = $client->api('repo')->workflowJobs()->downloadLogs('KnpLabs', 'php-github-api', $jobId); | ||
file_put_contents('jobLogs.zip', $jobLogs); | ||
``` |
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,76 @@ | ||
## Repo / Workflow Runs API | ||
[Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) | ||
|
||
### List workflow runs for a repository | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-workflow-runs-for-a-repository | ||
|
||
```php | ||
$workflowRuns = $client->api('repo')->workflowRuns()->all('KnpLabs', 'php-github-api'); | ||
``` | ||
|
||
### List workflow runs | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-workflow-runs | ||
|
||
```php | ||
$runs = $client->api('repo')->workflowRuns()->listRuns('KnpLabs', 'php-github-api', $workflowId); | ||
``` | ||
|
||
### Get a workflow run | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-a-workflow-run | ||
|
||
```php | ||
$workflowRun = $client->api('repo')->workflowRuns()->show('KnpLabs', 'php-github-api', $runId); | ||
``` | ||
|
||
### Delete a workflow run | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#delete-a-workflow-run | ||
|
||
```php | ||
$client->api('repo')->workflowRuns()->remove('KnpLabs', 'php-github-api', $runId); | ||
``` | ||
|
||
### Re-run a workflow | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#re-run-a-workflow | ||
|
||
```php | ||
$client->api('repo')->workflowRuns()->rerun('KnpLabs', 'php-github-api', $runId); | ||
``` | ||
|
||
### Cancel a workflow run | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#cancel-a-workflow-run | ||
|
||
```php | ||
$client->api('repo')->workflowRuns()->cancel('KnpLabs', 'php-github-api', $runId); | ||
``` | ||
|
||
### Get workflow run usage | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-workflow-run-usage | ||
|
||
```php | ||
$workflowUsage = $client->api('repo')->workflowRuns()->usage('KnpLabs', 'php-github-api', $runId); | ||
``` | ||
|
||
### Download workflow run logs | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#download-workflow-run-logs | ||
|
||
```php | ||
$logs = $client->api('repo')->workflowRuns()->downloadLogs('KnpLabs', 'php-github-api', $runId); | ||
|
||
file_put_contents('logs.zip', $logs); | ||
``` | ||
|
||
### Delete workflow run logs | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#delete-workflow-run-logs | ||
|
||
```php | ||
$client->api('repo')->workflowRuns()->deleteLogs('KnpLabs', 'php-github-api', $runId); | ||
``` |
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,26 @@ | ||
## Repo / Workflows API | ||
[Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) | ||
|
||
### List repository workflows | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-repository-workflows | ||
|
||
```php | ||
$workflows = $client->api('repo')->workflows()->all('KnpLabs', 'php-github-api'); | ||
``` | ||
|
||
### Get a workflow | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-a-workflow | ||
|
||
```php | ||
$workflow = $client->api('repo')->workflows()->show('KnpLabs', 'php-github-api', $workflowId); | ||
``` | ||
|
||
### Get workflow usage | ||
|
||
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-workflow-usage | ||
|
||
```php | ||
$usage = $client->api('repo')->workflows()->usage('KnpLabs', 'php-github-api', $workflowId); | ||
``` |
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.