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) : 
inherited
since

1.0

Arguments

options

Registry|nullGitHub options object.

client

Http|nullThe HTTP client object.

Response

mixed

__get

Magic method to lazily create API objects

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

1.0

throws

InvalidArgumentException

Arguments

name

stringName of property to retrieve

Response

AbstractPackageGitHub API package object.

create

Create a release.

create( user,  repo,  tagName,  targetCommitish = '',  name = '',  body = '',  draft = false,  preRelease = false) : 
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( owner,  repo,  releaseId) : 
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( user,  repo,  assetId) : 
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( user,  repo,  releaseId,  tagName,  targetCommitish = null,  name = null,  body = null,  draft = null,  preRelease = null) : 
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( user,  repo,  assetId,  name,  label = '') : 
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( path,  page,  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

Uri

get

Get a single release.

get( user,  repo,  ref) : 
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( user,  repo,  assetId) : 
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( user,  repo,  tag) : 
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( user,  repo) : 

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( user,  repo,  page,  limit) : mixed||string|int
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

array<string|int, mixed>An associative array of releases keyed by the tag name.

getListAssets

List assets for a release.

getListAssets( user,  repo,  releaseId,  page,  limit) : 
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,  expectedCode = 200) : 
inherited
since

1.0

throws

UnexpectedResponseException

Arguments

response

ResponseThe response.

expectedCode

intThe expected "good" code.

Response

mixed

Properties

options

Options for the GitHub object.

inherited
since

1.0

Type(s)

Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

1.0

Type(s)

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