GitLab API

GitlabTool

Actions905

Overview

This node operation allows users to create a protected tag in a specific GitLab project by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/protected_tags`. It is useful for managing project tags with protection rules, ensuring that only authorized users can create or update tags in a project. Practical examples include automating the protection of release tags or important version tags in a CI/CD pipeline.

Use Case Examples

  1. Automate the creation of protected tags for release versions in a GitLab project.
  2. Enforce tag protection policies programmatically to prevent unauthorized tag modifications.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used for the request, defaulting to GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is POST for this operation.
Path Parameters Parameters to be included in the request path, specifically the project ID or URL-encoded path.

Output

JSON

  • id - ID of the created protected tag.
  • name - Name of the protected tag.
  • create_access_levels - Access levels allowed to create the protected tag.
  • update_access_levels - Access levels allowed to update the protected tag.
  • unprotect_access_levels - Access levels allowed to unprotect the tag.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the provided authentication.
  • Verify that the authentication credentials (GitLab API key) are valid and have sufficient permissions to create protected tags.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 401 Unauthorized (invalid or missing authentication), 404 Not Found (project ID does not exist), and 403 Forbidden (insufficient permissions). Resolving these involves verifying credentials, project ID, and user permissions.

Links

Discussion