Method: Github::Client::Repos::Contents#delete

Defined in:
lib/github_api2/client/repos/contents.rb

#delete(*args) ⇒ Object

Delete a file

This method deletes a file in a repository

Optional Parameters

The :author section is optional and is filled in with the :committer information if omitted. If the :committer information is omitted, the authenticated user’s information is used.

You must provide values for both :name and :email, whether you choose to use :author or :committer. Otherwise, you’ll receive a 500 status code.

Both the author and commiter parameters have the same keys:

Examples:

github = Github.new
github.repos.contents.delete 'user-name', 'repo-name', 'path',
  path: 'hello.rb',
  message: "delete hello.rb file",
  sha: "329688480d39049927147c162b9d2deaf885005f"

Parameters:



219
220
221
222
223
224
225
# File 'lib/github_api2/client/repos/contents.rb', line 219

def delete(*args)
  arguments(args, required: [:user, :repo, :path]) do
    assert_required %w[ path message sha ]
  end

  delete_request("/repos/#{arguments.user}/#{arguments.repo}/contents/#{arguments.path}", arguments.params)
end