GitLab API icon

GitLab API

Gitlab

Actions880

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 DevOps engineer can use this node to automate the creation of repository protection rules to restrict who can delete or modify container images in a project's registry.

Use Case Examples

  1. Automate setting repository protection rules for a GitLab project registry to enforce security policies.
  2. Integrate with CI/CD pipelines to dynamically update registry protection rules based on deployment environments.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated API access.
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 can be set to POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Parameters to be included in the request path, specifically the project ID or URL-encoded path to identify the project.

Output

JSON

  • id - The ID or URL-encoded path of the project for which the repository protection rule is applied.
  • postApiV4ProjectsIdRegistryProtectionRepositoryRules - The body of the request containing the repository protection rule details to be posted to the GitLab API.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the authenticated user.
  • Verify that the request body schema matches the expected format for repository protection rules as defined by the GitLab API.
  • Check network connectivity and base URL correctness if the GitLab instance is self-hosted or different from the default https://gitlab.com.
  • Authentication errors may occur if the API key is missing, invalid, or lacks sufficient permissions to modify project registry settings.

Links

Discussion