GitLab API

GitlabTool

Actions1000

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 access and security settings related to package handling within a project. For example, a user can define rules to restrict who can publish or delete packages in a project repository.

Use Case Examples

  1. Creating a package protection rule for a project to restrict package publishing to certain user roles.
  2. Automating the management of package protection rules across multiple projects in GitLab.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance to which the API request is sent.
Method HTTP method used for the API request, defaulting to GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Parameters included in the API request path, specifically the project ID or URL-encoded path.

Output

JSON

  • id - The ID 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 - Access level required to interact with the package according to the rule.

Dependencies

  • GitLab 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 credentials (GitLab API key) are valid and have sufficient permissions to create package protection rules.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages include 401 Unauthorized (invalid or missing authentication), 404 Not Found (invalid project ID), and 400 Bad Request (invalid request body). Resolving these involves correcting credentials, project ID, or request data format.

Links

Discussion