Releases

Extends \Joomla\Github\AbstractPackage

GitHub API References class for the Joomla Platform.

link

https://developer.github.com/v3/repos/releases

since

1.1.0

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry $options = null, \Joomla\Http\Http $client = null) 
inherited
since

1.0

Arguments

$options

\Joomla\Registry\RegistryGitHub options object.

$client

\Joomla\Http\HttpThe HTTP client object.

__get

Magic method to lazily create API objects

__get(string $name) : \Joomla\Github\AbstractPackage
inherited
since

1.0

throws

\InvalidArgumentException

Arguments

$name

stringName of property to retrieve

Response

\Joomla\Github\AbstractPackageGitHub API package object.

create

Create a release.

create(string $user, string $repo, string $tagName, string $targetCommitish = '', string $name = '', string $body = '', boolean $draft = false, boolean $preRelease = false) : object
link

http://developer.github.com/v3/repos/releases/#create-a-release

since

1.1.0

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$tagName

stringThe name of the tag.

$targetCommitish

stringThe commitish value that determines where the Git tag is created from.

$name

stringThe name of the release.

$body

stringText describing the contents of the tag.

$draft

booleanTrue to create a draft (unpublished) release, false to create a published one.

$preRelease

booleanTrue to identify the release as a prerelease. false to identify the release as a full release.

Response

object

delete

Delete a release.

delete(string $owner, string $repo, integer $releaseId) : object
since

1.4.0

Arguments

$owner

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$releaseId

integerThe release id.

Response

object

deleteAsset

Delete a release asset.

deleteAsset(string $user, string $repo, integer $assetId) : boolean
since

1.4.0

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$assetId

integerThe asset id.

Response

boolean

edit

Edit a release.

edit(string $user, string $repo, integer $releaseId, string $tagName, string $targetCommitish = null, string $name = null, boolean $body = null, boolean $draft = null, string $preRelease = null) : object
link

http://developer.github.com/v3/repos/releases/#edit-a-release

since

1.1.0

throws

\DomainException

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$releaseId

integerThe release id.

$tagName

stringThe name of the tag.

$targetCommitish

stringThe commitish value that determines where the Git tag is created from.

$name

stringThe branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

$body

booleanThe body text for the new pull request.

$draft

booleanThe branch (or git ref) where your changes are implemented.

$preRelease

stringThe branch (or git ref) where your changes are implemented.

Response

object

editAsset

Edit a release asset.

editAsset(string $user, string $repo, integer $assetId, string $name, string $label = '') : object
since

1.4.0

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$assetId

integerThe asset id.

$name

stringThe file name of the asset.

$label

stringAn alternate short description of the asset. Used in place of the filename.

Response

object

fetchUrl

Method to build and return a full request URL for the request. This method will add appropriate pagination details if necessary and also prepend the API url to have a complete URL for the request.

fetchUrl(string $path, integer $page, integer $limit) : string
inherited
since

1.0

note

As of 2.0 this method will return a Joomla\Uri\Uri object

Arguments

$path

stringURL to inflect

$page

integerPage to request

$limit

integerNumber of results to return per page

Response

stringThe request URL.

get

Get a single release.

get(string $user, string $repo, string $ref) : object
since

1.1.0

throws

\DomainException

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$ref

stringValid values are: 'latest', 'tags/2.0.24' or Release Id, for example: '1643513'

Response

object

getAsset

Get a single release asset.

getAsset(string $user, string $repo, integer $assetId) : object
since

1.4.0

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$assetId

integerThe asset id.

Response

object

getByTag

Get a release by tag name.

getByTag(string $user, string $repo, string $tag) : object
since

1.4.0

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$tag

stringThe name of the tag.

Response

object

getLatest

Get the latest release.

getLatest(string $user, string $repo) : object

View the latest published full release for the repository. Draft releases and prereleases are not returned by this endpoint.

since

1.4.0

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

Response

object

getList

List releases for a repository.

getList(string $user, string $repo, integer $page, integer $limit) : array
since

1.1.0

throws

\DomainException

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

arrayAn associative array of releases keyed by the tag name.

getListAssets

List assets for a release.

getListAssets(string $user, string $repo, integer $releaseId, integer $page, integer $limit) : object
since

1.4.0

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$releaseId

integerThe release id.

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

object

processResponse

Process the response and decode it.

processResponse(\Joomla\Http\Response $response, integer $expectedCode = 200) : mixed
inherited
since

1.0

throws

\Joomla\Http\Exception\UnexpectedResponseException

Arguments

$response

\Joomla\Http\ResponseThe response.

$expectedCode

integerThe expected "good" code.

Response

mixed

Properties

options

Options for the GitHub object.

inherited
since

1.0

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

1.0

Type(s)

\Joomla\Github\Http

package

The package the object resides in

inherited
since

1.0

Type(s)

string

hookEvents

Array containing the allowed hook events

inherited
since

1.5.2

link

https://developer.github.com/webhooks/#events

note

From 1.4.0 to 1.5.1 this was named $events, it was renamed due to naming conflicts with package subclasses

Type(s)

array