class Github::Repos::Releases

The Releases API

def assets(options = {}, &block)

Access to Repos::Releases::Assets API
def assets(options = {}, &block)
  @assets ||= ApiFactory.new('Repos::Releases::Assets', current_options.merge(options), &block)
end

def create(*args)


"prerelease": false
"draft": false,
"body": "Description of the release",
"name": "v1.0.0",
"target_commitish": "master",
"tag_name": "v1.0.0",
github.repos.releases.create 'owner', 'repo', 'tag-name',
github = Github.new
= Examples

the release as a full release. Default is false.
the release as a prerelease. false to identify
* :prerelease - Optional boolean - true to identify
a published one. Default is false.
(unpublished) release, false to create
* :draft - Optional boolean - true to create a draft
* :body - Optional string
* :name - Optional string
branch (usually 'master'). Unused if the Git tag already exists.
any branch or commit SHA. Defaults to the repository's default
value that determines where the Git tag is created from. Can be
* :target_commitish - Optional string - Specifies the commitish
* :tag_name - Required string
= Inputs

Create a release
def create(*args)
  arguments(args, required: [:owner, :repo, :tag_name]) do
    sift VALID_RELEASE_PARAM_NAMES
  end
  params = arguments.params
  params['tag_name'] = tag_name
  post_request("/repos/#{owner}/#{repo}/releases", params)
end

def delete(*args)


github.repos.releases.delete 'owner', 'repo', 'id'
github = Github.new
= Examples

Users with push access to the repository can delete a release.

Delete a release
def delete(*args)
  params = arguments(args, required: [:owner, :repo, :id]).params
  delete_request("/repos/#{owner}/#{repo}/releases/#{id}", params)
end

def edit(*args)


"prerelease": false
"draft": false,
"body": "Description of the release",
"name": "v1.0.0",
"target_commitish": "master",
"tag_name": "v1.0.0",
github.repos.releases.edit 'owner', 'repo', 'id',
github = Github.new
= Examples

the release as a full release. Default is false.
the release as a prerelease. false to identify
* :prerelease - Optional boolean - true to identify
a published one. Default is false.
(unpublished) release, false to create
* :draft - Optional boolean - true to create a draft
* :body - Optional string
* :name - Optional string
branch (usually 'master'). Unused if the Git tag already exists.
any branch or commit SHA. Defaults to the repository's default
value that determines where the Git tag is created from. Can be
* :target_commitish - Optional string - Specifies the commitish
* :tag_name - Required string
= Inputs

Edit a release
def edit(*args)
  arguments(args, required: [:owner, :repo, :id]) do
    sift VALID_RELEASE_PARAM_NAMES
  end
  params = arguments.params
  patch_request("/repos/#{owner}/#{repo}/releases/#{id}", params)
end

def get(*args)


github.repos.releases.get 'owner', 'repo', 'id'
github = Github.new
= Examples

Get a single release
def get(*args)
  params = arguments(args, required: [:owner, :repo, :id]).params
  get_request("/repos/#{owner}/#{repo}/releases/#{id}" , params)
end

def list(*args)


github.repos.releases.list 'owner', 'repo' { |release| ... }
github.repos.releases.list 'owner', 'repo'
github = Github.new
= Examples

will receive published releases only.
(i.e., published releases and draft releases). Users with pull access
Users with push access to the repository will receive all releases

List releases for a repository
def list(*args)
  params = arguments(args, required: [:owner, :repo]).params
  response = get_request("/repos/#{owner}/#{repo}/releases", params)
  return response unless block_given?
  response.each { |el| yield el }
end