Skip to content

Latest commit

 

History

History
84 lines (53 loc) · 2.18 KB

workflow_runs.md

File metadata and controls

84 lines (53 loc) · 2.18 KB

Repo / Actions / Workflow Runs API

Back to the "Repos API" | Back to the navigation

List workflow runs for a repository

https://docs.github.com/en/rest/reference/actions#list-workflow-runs-for-a-repository

$workflowRuns = $client->api('repo')->workflowRuns()->all('KnpLabs', 'php-github-api');

List workflow runs

https://docs.github.com/en/rest/reference/actions#list-workflow-runs

$runs = $client->api('repo')->workflowRuns()->listRuns('KnpLabs', 'php-github-api', $workflow);

Get a workflow run

https://docs.github.com/en/rest/reference/actions#get-a-workflow-run

$workflowRun = $client->api('repo')->workflowRuns()->show('KnpLabs', 'php-github-api', $runId);

Delete a workflow run

https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run

$client->api('repo')->workflowRuns()->remove('KnpLabs', 'php-github-api', $runId);

Re-run a workflow

https://docs.github.com/en/rest/reference/actions#re-run-a-workflow

$client->api('repo')->workflowRuns()->rerun('KnpLabs', 'php-github-api', $runId);

Cancel a workflow run

https://docs.github.com/en/rest/reference/actions#cancel-a-workflow-run

$client->api('repo')->workflowRuns()->cancel('KnpLabs', 'php-github-api', $runId);

Get workflow run usage

https://docs.github.com/en/rest/reference/actions#get-workflow-run-usage

$workflowUsage = $client->api('repo')->workflowRuns()->usage('KnpLabs', 'php-github-api', $runId);

Download workflow run logs

https://docs.github.com/en/rest/reference/actions#download-workflow-run-logs

$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/rest/reference/actions#delete-workflow-run-logs

$client->api('repo')->workflowRuns()->deleteLogs('KnpLabs', 'php-github-api', $runId);

Approve workflow run

https://docs.github.com/en/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request

$client->api('repo')->workflowRuns()->approve('KnpLabs', 'php-github-api', $runId);