# encoding: utf-8moduleGithub# The Releases APIclassClient::Repos::Releases<APIrequire_all'github_api/client/repos/releases','assets'VALID_RELEASE_PARAM_NAMES=%w[
tag_name
target_commitish
name
body
draft
prerelease
].freeze# :nodoc:# Access to Repos::Releases::Assets APInamespace:assets# List releases for a repository## Users with push access to the repository will receive all releases# (i.e., published releases and draft releases). Users with pull access# will receive published releases only.## @example# github = Github.new# github.repos.releases.list 'owner', 'repo'# github.repos.releases.list 'owner', 'repo' { |release| ... }## @api publicdeflist(*args)arguments(args,required: [:owner,:repo]).paramsresponse=get_request("/repos/#{arguments.owner}/#{arguments.repo}/releases",arguments.params)returnresponseunlessblock_given?response.each{|el|yieldel}endalias:all:list# Get a single release## @example# github = Github.new# github.repos.releases.get 'owner', 'repo', 'id'## @api publicdefget(*args)arguments(args,required: [:owner,:repo,:id]).paramsget_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/#{arguments.id}",arguments.params)endalias:find:get# Create a release## @param [Hash] params# @input params [String] :tag_name# Required. The name of the tag.# @input params [String] :target_commitish# Specifies the commitish value that determines where the Git tag# is created from. Can be any branch or commit SHA. Defaults to# the repository's default branch (usually 'master').# Unused if the Git tag already exists.# @input params [String] :name# The name of the release.# @input params [String] :body# Text describing the contents of the tag.# @input params [Boolean] :draft# true to create a draft (unpublished) release,# false to create a published one. Default: false# @input params [Boolean] :prerelease# true to identify the release as a prerelease.# false to identify the release as a full release. Default: false## @example# github = Github.new# github.repos.releases.create 'owner', 'repo', 'tag-name',# tag_name: "v1.0.0",# target_commitish: "master",# name: "v1.0.0",# body: "Description of the release",# draft: false,# prerelease: false## @api publicdefcreate(*args)arguments(args,required: [:owner,:repo,:tag_name])dopermitVALID_RELEASE_PARAM_NAMESendparams=arguments.paramsparams['tag_name']=arguments.tag_namepost_request("/repos/#{arguments.owner}/#{arguments.repo}/releases",params)end# Edit a release## @param [Hash] params# @input params [String] :tag_name# Required. The name of the tag.# @input params [String] :target_commitish# Specifies the commitish value that determines where the Git tag# is created from. Can be any branch or commit SHA. Defaults to# the repository's default branch (usually 'master').# Unused if the Git tag already exists.# @input params [String] :name# The name of the release.# @input params [String] :body# Text describing the contents of the tag.# @input params [Boolean] :draft# true to create a draft (unpublished) release,# false to create a published one. Default: false# @input params [Boolean] :prerelease# true to identify the release as a prerelease.# false to identify the release as a full release. Default: false## @example# github = Github.new# github.repos.releases.edit 'owner', 'repo', 'id',# tag_name: "v1.0.0",# target_commitish: "master",# name: "v1.0.0",# body: "Description of the release",# draft: false,# prerelease: false## @api publicdefedit(*args)arguments(args,required: [:owner,:repo,:id])dopermitVALID_RELEASE_PARAM_NAMESendpatch_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/#{arguments.id}",arguments.params)endalias:update:edit# Delete a release## Users with push access to the repository can delete a release.## @example# github = Github.new# github.repos.releases.delete 'owner', 'repo', 'id'## @api publicdefdelete(*args)arguments(args,required: [:owner,:repo,:id]).paramsdelete_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/#{arguments.id}",arguments.params)endend# Client::Repos::Statusesend# Github