GitLab API

GitlabTool

Actions1000

Overview

This node operation performs a HEAD request to the GitLab API endpoint for a specific branch in a project's repository. It is useful for checking the existence or metadata of a branch without retrieving the full branch details. Common scenarios include verifying if a branch exists before performing further actions or validating branch status in automation workflows.

Use Case Examples

  1. Check if a branch named 'feature-xyz' exists in a project with ID '12345' before triggering a deployment pipeline.
  2. Validate branch presence in a repository to conditionally execute subsequent steps in a CI/CD process.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, defaulting to GET but can be set to HEAD for this operation.
Path Parameters Parameters to specify the project ID and branch name for the API request.

Output

JSON

  • headers - HTTP response headers from the HEAD request, useful for metadata about the branch.

Dependencies

  • GitLab API key credential for authentication unless Skip Authentication is enabled.

Troubleshooting

  • Ensure the project ID and branch name are correctly specified and URL-encoded if necessary.
  • If authentication is required, verify that the GitLab API key credential is correctly configured and has sufficient permissions.
  • A 404 response indicates the branch or project does not exist; verify the inputs.
  • A 401 or 403 response indicates authentication or permission issues; check credentials and access rights.

Links

Discussion