GitLab API

GitlabTool

Actions905

Overview

This node operation allows users to create package protection rules for a specific project in GitLab via the GitLab API. It is useful for managing package access control within a project, ensuring that only authorized users can interact with protected packages. For example, a DevOps engineer might use this node to enforce package security policies in a CI/CD pipeline.

Use Case Examples

  1. Creating a package protection rule for a project to restrict package access to certain user roles.
  2. Automating package protection rule creation as part of project setup workflows.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, here it is POST for creating the protection rule.
Path Parameters Parameters included in the request path, specifically the project ID or URL-encoded path identifying the project for which the package protection rule is created.

Output

JSON

  • id - The unique identifier of the created package protection rule.
  • name - The name of the package protection rule.
  • project_id - The ID of the project to which the rule applies.
  • created_at - Timestamp when the rule was created.
  • updated_at - Timestamp when the rule was last updated.
  • access_level - The access level required to interact with the protected package.

Dependencies

  • GitLab API authentication token or API key credential

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 package protection rules in the project.
  • Check the base URL to confirm it points to the correct GitLab instance.
  • If the API returns permission errors, confirm the user role and access rights in the GitLab project.

Links

Discussion