GitLab API icon

GitLab API

Gitlab

Actions1062

Branches → headApiV4ProjectsIdRepositoryBranchesBranch

AI-generated

Summary

Check the existence and accessibility of a specific branch in a GitLab project by sending a HEAD request to the GitLab API endpoint for that branch.

Inputs

  • Id (required) — The ID or URL-encoded path of the GitLab project where the branch resides.
  • Branch (required) — The name of the branch to verify.
  • Skip Authentication — Whether to skip authenticating the request (default is false).
  • baseUrl — The base URL of the GitLab instance; defaults to https://gitlab.com.

Output shape

no body — success indicated by HTTP status code, typically 200 if the branch exists and is accessible; 404 if not found or inaccessible.

The operation issues a HEAD request to the path /api/v4/projects/{id}/repository/branches/{branch}. No response body is returned; success or failure is conveyed via status codes. Authentication is required unless explicitly skipped.

Examples

Example 1: Verify if a branch named 'feature-xyz' exists in project with ID 123

Set Id to '123' and Branch to 'feature-xyz'. The node sends a HEAD request to check the branch's presence without obtaining branch details.

Links

Discussion