GitLab API

GitlabTool

Actions905

Overview

This node operation deletes job artifacts from a specific job within a GitLab project. It is useful for automating cleanup of build artifacts generated by CI/CD jobs in GitLab projects, helping to manage storage and maintain project hygiene. For example, it can be used to delete artifacts from completed or failed jobs to free up space or enforce retention policies.

Use Case Examples

  1. Delete artifacts from a specific job in a GitLab project to free up storage.
  2. Automate cleanup of old job artifacts in a CI/CD pipeline.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the request.
Authentication The authentication method used for the request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, defaulting to GET but here it is DELETE for this operation.
Path Parameters Parameters for the API path including the project ID or URL-encoded path and the job ID whose artifacts are to be deleted.

Output

JSON

  • statusCode - HTTP status code of the delete operation response.
  • responseBody - Response body from the API after attempting to delete the job artifacts.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and job ID are correct and exist in GitLab; otherwise, the API will return an error.
  • Authentication errors may occur if the API key is missing, invalid, or lacks sufficient permissions to delete job artifacts.
  • Network or base URL misconfiguration can cause request failures; verify the baseUrl is correct for your GitLab instance.

Links

Discussion