GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows creating a protected tag in a specific GitLab project by sending a POST request to the GitLab API endpoint `/api/v4/projects/{id}/protected_tags`. It is useful for managing project tags with restricted access, ensuring only authorized users can create or modify certain tags. For example, a DevOps engineer might use this to protect release tags in a CI/CD pipeline.

Use Case Examples

  1. Creating a protected tag for a project to restrict who can push or delete tags.
  2. Automating tag protection as part of a GitLab project setup script.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated API calls.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but POST is used for this operation.
Path Parameters Parameters to specify the project ID or URL-encoded path for which the protected tag is created.

Output

JSON

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

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID or path is correct and URL-encoded if necessary.
  • Verify that the authentication token has 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 (authentication failure), 404 Not Found (invalid project ID), and 403 Forbidden (insufficient permissions).

Links

Discussion