module Octokit::Client::CommitComments
def commit_comment(repo, id, options = {})
- See: https://developer.github.com/v3/repos/comments/#get-a-single-commit-comment -
Returns:
-
(Sawyer::Resource)- Commit comment
Parameters:
-
id(String) -- The ID of the comment to fetch -
repo(Integer, String, Hash, Repository) -- A GitHub repository
def commit_comment(repo, id, options = {}) get "#{Repository.path repo}/comments/#{id}", options end
def commit_comments(repo, sha, options = {})
- See: https://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit -
Returns:
-
(Array)- List of commit comments
Parameters:
-
sha(String) -- The SHA of the commit whose comments will be fetched -
repo(Integer, String, Hash, Repository) -- A GitHub repository
def commit_comments(repo, sha, options = {}) paginate "#{Repository.path repo}/commits/#{sha}/comments", options end
def create_commit_comment(repo, sha, body, path = nil, line = nil, position = nil, options = {})
- Example: Create a commit comment -
Other tags:
- See: https://developer.github.com/v3/repos/comments/#create-a-commit-comment -
Returns:
-
(Sawyer::Resource)- Commit comment
Parameters:
-
position(Integer) -- Line index in the diff to comment on -
line(Integer) -- Line number in the file to comment on -
path(String) -- Relative path of file to comment on -
body(String) -- Message -
sha(String) -- Sha of the commit to comment on -
repo(Integer, String, Hash, Repository) -- A GitHub repository
def create_commit_comment(repo, sha, body, path = nil, line = nil, position = nil, options = {}) params = { body: body, path: path, line: line, position: position } post "#{Repository.path repo}/commits/#{sha}/comments", options.merge(params) end
def delete_commit_comment(repo, id, options = {})
- See: https://developer.github.com/v3/repos/comments/#delete-a-commit-comment -
Returns:
-
(Boolean)- Success
Parameters:
-
id(String) -- The ID of the comment to delete -
repo(Integer, String, Hash, Repository) -- A GitHub repository
def delete_commit_comment(repo, id, options = {}) boolean_from_response :delete, "#{Repository.path repo}/comments/#{id}", options end
def list_commit_comments(repo, options = {})
- See: https://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository -
Returns:
-
(Array)- List of commit comments
Parameters:
-
repo(Integer, String, Hash, Repository) -- A GitHub repository
def list_commit_comments(repo, options = {}) paginate "#{Repository.path repo}/comments", options end
def update_commit_comment(repo, id, body, options = {})
- Example: Update a commit comment -
Other tags:
- See: https://developer.github.com/v3/repos/comments/#update-a-commit-comment -
Returns:
-
(Sawyer::Resource)- Updated commit comment
Parameters:
-
body(String) -- Message -
id(String) -- The ID of the comment to update -
repo(Integer, String, Hash, Repository) -- A GitHub repository
def update_commit_comment(repo, id, body, options = {}) params = { body: body } patch "#{Repository.path repo}/comments/#{id}", options.merge(params) end