class Github::Repos::Releases::Assets
def upload(*args)
"content_type": "application/octet-stream"
"name": "batman.jpg",
github.repos.releases.assets.upload 'owner', 'repo', 'id', 'file-path'
github = Github.new
= Examples
of the asset. Example: “application/zip”.
* :content_type - Required string - The content type
* :name - Required string - The file name of the asset
= Inputs
Upload a release asset
def upload(*args) arguments(args, required: [:owner, :repo, :id, :filepath]) do sift VALID_ASSET_PARAM_NAMES end params = arguments.params unless type = params['content_type'] type = infer_media(filepath) end file = Faraday::UploadIO.new(filepath, type) options = { headers: { content_type: type }, endpoint: 'https://uploads.github.com', query: {'name' => params['name']} } params['data'] = file.read params['options'] = options post_request("/repos/#{owner}/#{repo}/releases/#{id}/assets", params) ensure file.close if file end