Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.52 KB

releases.md

File metadata and controls

55 lines (38 loc) · 1.52 KB

Repo / Releases API

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

Provides information about releases for a repository. Wraps GitHub Releases API.

Get latest actual release

$release = $client->api('repo')->releases()->latest('twbs', 'bootstrap');

The latest() method fetches only releases which are not marked "prerelease" or "draft".

To obtain the latest release including prereleases and drafts, select the first element in the "all releases" function:

$release = $client->api('repo')->releases()->all('username', 'repo')[0];

Note: Draft releases are only visible to authenticated users who have push access to the repository.

List releases for a tag

$release = $client->api('repo')->releases()->all('twbs', 'bootstrap', 'd890eec');

List all releases

$releases = $client->api('repo')->releases()->all('twbs', 'bootstrap');

List one release

$release = $client->api('repo')->releases()->show('twbs', 'bootstrap', $id);

Create a release

$release = $client->api('repo')->releases()->create('twbs', 'bootstrap', array('tag_name' => 'v1.1'));

Edit a release

$release = $client->api('repo')->releases()->edit('twbs', 'bootstrap', $id, array('name' => 'New release name'));

Remove a release

This works, but isn't thoroughly tested, use at your own risk.

$response = $client->api('repo')->releases()->remove('twbs', 'bootstrap', $id);