GitLab API

GitlabTool

Actions1000

Overview

This node operation allows users to create or post repository protection rules for a specific project's container registry in GitLab. It is useful for managing access control and protection settings on container registry repositories within a GitLab project. For example, a user can define rules to restrict who can delete or modify container images in the project's registry.

Use Case Examples

  1. Creating a new repository protection rule for a GitLab project to restrict deletion rights.
  2. Automating the management of container registry access policies in a CI/CD pipeline.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the request (boolean). Defaults to false.
Authentication The authentication method used, typically an API key credential for GitLab API.
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 can be POST, PUT, DELETE, HEAD, PATCH.
Path Parameters Parameters to be included in the request path, specifically the project ID or URL-encoded path.

Output

JSON

  • id - The ID of the created repository protection rule.
  • project_id - The ID of the project to which the rule applies.
  • name - The name of the repository protection rule.
  • created_at - Timestamp when the rule was created.
  • updated_at - Timestamp when the rule was last updated.
  • access_level - The access level required to modify or delete the repository.

Dependencies

  • GitLab API authentication token

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the authenticated user.
  • Verify that the authentication token has sufficient permissions to create or modify registry protection rules.
  • Check that the HTTP method is set to POST when creating new rules.
  • Common error messages include 401 Unauthorized (authentication failure), 403 Forbidden (insufficient permissions), and 404 Not Found (invalid project ID).

Links

Discussion