GitLab API

GitlabTool

Actions1000

Overview

This node operation allows users to erase a specific job within a GitLab project by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/jobs/{job_id}/erase`. It is useful for scenarios where a user needs to remove job data from a project, such as cleaning up old or unnecessary build jobs in a CI/CD pipeline.

Use Case Examples

  1. Erase a job with ID 88 in a project with ID 123 to free up space or remove sensitive build data.
  2. Automate job cleanup in GitLab projects as part of a maintenance workflow.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated endpoints.
Authentication Select the authentication method, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but POST is used for this operation.
Path Parameters Parameters required in the URL path to identify the project and job to erase.

Output

JSON

  • statusCode - HTTP status code returned by the API indicating success or failure of the erase operation.
  • responseBody - The JSON response body from the GitLab API after attempting to erase the job, containing details or confirmation.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the job_id and project id are correctly provided and exist in GitLab to avoid 404 errors.
  • Check that the API key has sufficient permissions to erase jobs in the project to avoid authorization errors.
  • If skipping authentication, verify that the GitLab instance allows unauthenticated requests for this endpoint, otherwise the request will fail.

Links

Discussion