Releases

Extends AbstractPackage

GitHub API References class for the Joomla Platform.

link
since

1.1.0

package

Joomla Framework

Methods

__construct

Constructor.

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

1.0

Arguments

options

\Joomla\Registry\RegistryGitHub options object.

client

\Joomla\Http\HttpThe HTTP client object.

Response

mixed

__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 = '', bool draft = false, bool preRelease = false) : object
link
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

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

preRelease

boolTrue 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, int 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

intThe release id.

Response

object

deleteAsset

Delete a release asset.

deleteAsset(string user, string repo, int assetId) : bool
since

1.4.0

Arguments

user

stringThe name of the owner of the GitHub repository.

repo

stringThe name of the GitHub repository.

assetId

intThe asset id.

Response

bool

edit

Edit a release.

edit(string user, string repo, int releaseId, string tagName, string targetCommitish = null, string name = null, bool body = null, bool draft = null, string preRelease = null) : object
link
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

intThe 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

boolThe body text for the new pull request.

draft

boolThe 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, int 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

intThe 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, int page, int limit) : \Joomla\Uri\Uri
inherited
since

1.0

Arguments

path

stringURL to inflect

page

intPage to request

limit

intNumber of results to return per page

Response

\Joomla\Uri\Uri

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, int 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

intThe 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, int page, int 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

intThe page number from which to get items.

limit

intThe 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, int releaseId, int page, int 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

intThe release id.

page

intThe page number from which to get items.

limit

intThe number of items on a page.

Response

object

processResponse

Process the response and decode it.

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

1.0

throws

\Joomla\Http\Exception\UnexpectedResponseException

Arguments

response

\Joomla\Http\ResponseThe response.

expectedCode

intThe 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\Http\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
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