GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation performs a HEAD request to the GitLab API endpoint for checking the existence and metadata of a specific file in a project's repository. It is useful for scenarios where you want to verify if a file exists in a GitLab project repository without downloading the file content, such as validating file presence before further processing or automation.

Use Case Examples

  1. Check if a specific file exists in a GitLab project repository by providing the project ID, file path, and reference (branch, tag, or commit).
  2. Use the HEAD method to retrieve metadata about a file in the repository without fetching the file content, useful for conditional workflows.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public repositories or unauthenticated access.
Authentication Type of authentication used, default is GitLab API key authentication.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but HEAD is used for this operation.
Parameter Schema Defines the required path and query parameters for the request, including project ID, file path, and reference (branch/tag/commit).
Request Path API endpoint path template for accessing the file in the repository.
Query Parameters Query parameters for the request, specifically the 'ref' parameter indicating the branch, tag, or commit name.
Path Parameters Path parameters for the request, including 'id' for project ID and 'file_path' for the URL encoded file path.

Output

JSON

  • statusCode - HTTP status code of the HEAD request indicating file existence and metadata presence.
  • headers - HTTP headers returned by the HEAD request containing metadata about the file.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and file path are correctly URL encoded to avoid 404 errors.
  • Verify that the 'ref' parameter (branch, tag, or commit) exists in the repository to prevent errors.
  • If authentication is required, ensure the GitLab API key credential is correctly configured and has sufficient permissions.
  • Common error 404 indicates the file does not exist at the specified path or reference.
  • 401 or 403 errors indicate authentication or permission issues.

Links

Discussion