GitLab API

GitlabTool

Actions1095

Commits → postApiV4ProjectsIdRepositoryCommitsShaComments

AI-generated

Summary

Posts a comment on a specific commit in a GitLab project repository.

Inputs

  • id (required) — The ID or URL-encoded path of the project.
  • sha (required) — A commit SHA, or the name of a branch or tag on which to post a comment.
  • postApiV4ProjectsIdRepositoryCommitsShaComments (required) — The request body schema containing the comment details.

Output shape

a single record

The record represents the created comment object. Path parameters (id, sha) must be provided. The request body schema defines the specific comment fields.

Examples

Example 1: Add a review comment to a specific commit SHA

Set path parameters id to 'my-project' and sha to 'abc1234', and configure the request body with a 'note' field.

Example 2: Add a status change comment to a merge request commit

Set path parameters id to 'my-project' and sha to 'feature-branch', and configure the request body with a 'note' and 'line_type' field.

Links

Discussion