GitLab API

GitlabTool

Actions905

Overview

This node operation deletes tags from a container registry repository in a GitLab project using the GitLab API. It is useful for managing and cleaning up container images by removing old or unwanted tags based on specified criteria such as tag name patterns, number of tags to keep, or age of tags. For example, it can be used to automate the cleanup of container tags in a CI/CD pipeline to save storage space and maintain repository hygiene.

Use Case Examples

  1. Deleting all tags matching a specific pattern in a container registry repository.
  2. Keeping only the latest N tags and deleting older ones based on tag name regex.
  3. Deleting tags older than a specified duration such as 1 month.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
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 DELETE is used for this operation.
Parameter Schema Defines the path and query parameters for the delete operation, including project ID, repository ID, and tag deletion filters.
Query Parameters Collection of optional query parameters to filter which tags to delete, such as name regex, number to keep, and age.
Path Parameters Collection of required path parameters including project ID and repository ID.

Output

JSON

  • statusCode - HTTP status code of the delete operation response.
  • responseBody - Response body returned from the GitLab API after deleting tags.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and repository ID are correct and accessible with the provided credentials.
  • Verify that the authentication token has sufficient permissions to delete container registry tags.
  • Check the format of query parameters such as regex patterns and date strings to avoid API errors.
  • Common error messages include 401 Unauthorized (invalid or missing credentials), 404 Not Found (invalid project or repository ID), and 400 Bad Request (invalid query parameters).
  • To resolve errors, verify credentials, parameter values, and API endpoint correctness.

Links

Discussion