GitLab API

GitlabTool

Actions1095

Projects → patchApiV4ProjectsIdRegistryProtectionRepositoryRulesProtectionRuleId

AI-generated

Summary

Update an existing container registry repository protection rule for a specified GitLab project using the project's ID or URL-encoded path and the protection rule's ID.

Inputs

  • Id (required) — The ID or URL-encoded path of the GitLab project to update the repository protection rule for.
  • Protection_rule_id (required) — The ID of the container protection rule to update.
  • Request Body (required) — The JSON object containing the fields and values to update in the protection rule, structured according to the patchApiV4ProjectsIdRegistryProtectionRepositoryRulesProtectionRuleId schema.

Output shape

a single JSON object representing the updated repository protection rule as returned by the GitLab API

Requires authentication via GitLab API credentials unless 'Skip Authentication' is set. The operation sends a PATCH request to the endpoint /api/v4/projects/{id}/registry/protection/repository/rules/{protection_rule_id}. The output matches the updated protection rule details returned by the GitLab API.

Examples

Example 1: Updating a container registry protection rule to modify its parameters

Provide the project ID or URL-encoded path, the protection rule ID, and the updated fields in the request body, then execute this operation to apply and retrieve the changes.

Links

Discussion