GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves commits from a GitLab project's repository using the GitLab API v4. It is useful for scenarios where you need to fetch commit history, filter commits by branch, date, author, or file path, and obtain detailed commit statistics. For example, it can be used to monitor recent changes in a project, analyze commit activity, or integrate commit data into other workflows.

Use Case Examples

  1. Fetch all commits from a specific branch of a GitLab project.
  2. Retrieve commits made by a particular author within a date range.
  3. Get commit statistics for a file in the repository.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Query Parameters Optional filters and pagination parameters for the commit retrieval.
Path Parameters Path parameter specifying the project ID or URL-encoded path.

Output

JSON

  • id - The unique identifier of the commit.
  • short_id - Shortened commit ID.
  • title - Commit title or message.
  • author_name - Name of the commit author.
  • author_email - Email of the commit author.
  • created_at - Timestamp when the commit was created.
  • message - Full commit message.
  • stats - Statistics about the commit, if requested.
  • trailers - Git trailers included in the commit, if requested.

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the project ID or path is correct and URL-encoded if necessary.
  • Verify that the authentication token has sufficient permissions to access the repository commits.
  • Check that the date formats for 'since' and 'until' parameters are in ISO 8601 format (e.g., 2021-09-20T11:50:22.001).
  • If pagination is used, ensure 'page' and 'per_page' parameters are set correctly to avoid missing data or excessive data retrieval.

Links

Discussion