Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.19 KB

artifacts.md

File metadata and controls

44 lines (28 loc) · 1.19 KB

Repo / Actions / Artifacts API

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

List artifacts for a repository

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

$artifacts = $client->api('repo')->artifacts()->all('KnpLabs');

List workflow run artifacts

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

$runArtifacts = $client->api('repo')->artifacts()->runArtifacts('KnpLabs', 'php-github-api', $runId);

Get an artifact

https://docs.github.com/en/rest/reference/actions#get-an-artifact

$artifact = $client->api('repo')->artifacts()->show('KnpLabs', 'php-github-api', $artifactId);

Delete an artifact

https://docs.github.com/en/rest/reference/actions#delete-an-artifact

$client->api('repo')->artifacts()->delete('KnpLabs', 'php-github-api', $artifactId);

Download an artifact

https://docs.github.com/en/rest/reference/actions#download-an-artifact

$artifactFile = $client->api('repo')->artifacts()->download('KnpLabs', 'php-github-api', $artifactId, $format = 'zip');
file_put_contents($artifactId.'.'.$format, $artifactFile);