Method: Gitlab::Client::Commits#create_commit_comment

Defined in:
lib/gitlab/client/commits.rb

#create_commit_comment(project, commit, note, options = {}) ⇒ Gitlab::ObjectifiedHash Also known as: repo_create_commit_comment

Creates a new comment for a commit.

Examples:

Gitlab.create_commit_comment(5, 'c9f9662a9b1116c838b523ed64c6abdb4aae4b8b', 'Nice work on this commit!')

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • sha (String)

    The commit hash or name of a repository branch or tag.

  • note (String)

    The text of a comment.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :path (String)

    The file path.

  • :line (Integer)

    The line number.

  • :line_type (String)

    The line type (new or old).

Returns:

[View source]

130
131
132
# File 'lib/gitlab/client/commits.rb', line 130

def create_commit_comment(project, commit, note, options = {})
  post("/projects/#{url_encode project}/repository/commits/#{commit}/comments", body: options.merge(note: note))
end