GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves blame information for a specific file in a GitLab project repository. It is useful for identifying which lines of code were last modified by which users, helping with code review, auditing, and understanding code history. For example, a developer can use this to see who last edited a particular range of lines in a file on a specific branch or commit.

Use Case Examples

  1. Get blame information for lines 10 to 20 of 'lib/class.rb' in the 'gitlab-org/gitlab' project on the 'main' branch.
  2. Audit code changes by retrieving blame data for a file to track contributions.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the request.
Authentication The authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, defaulting to GET.
Query Parameters Query parameters for the request including 'ref' (branch, tag, or commit), 'range[start]' (first line of the range to blame), and 'range[end]' (last line of the range to blame).
Path Parameters Path parameters for the request including 'id' (project ID) and 'file_path' (URL encoded path to the file).

Output

JSON

  • blame - Blame information for the specified file and line range, showing which user last modified each line.

Dependencies

  • GitLab API authentication

Troubleshooting

  • Ensure the project ID and file path are correctly URL encoded and valid.
  • Verify that the 'ref' parameter corresponds to an existing branch, tag, or commit in the repository.
  • Check that the specified line range is within the bounds of the file.
  • Authentication errors may occur if the API token is missing or invalid; ensure proper credentials are provided.

Links

Discussion