GitLab API

GitlabTool

Actions1000

Overview

This node operation performs a housekeeping task on a specific project in GitLab by sending a POST request to the GitLab API endpoint `/api/v4/projects/{id}/housekeeping`. It is useful for maintaining and optimizing the project repository by cleaning up unnecessary files and data. Typical use cases include automating repository maintenance as part of a CI/CD pipeline or scheduled workflows to keep the project repository healthy.

Use Case Examples

  1. Automate repository housekeeping for a project with ID '12345' to optimize storage and performance.
  2. Integrate project housekeeping into a GitLab management workflow to regularly clean up repositories.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, typically a GitLab API key credential.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the request, default is POST for this operation.
Path Parameters Parameters included in the request path, specifically the project ID or URL-encoded path.

Output

JSON

  • statusCode - HTTP status code returned by the API after the housekeeping request.
  • responseBody - The JSON response body from the GitLab API, typically indicating the result of the housekeeping operation.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the authenticated user.
  • Verify that the GitLab API key credential is valid and has sufficient permissions to perform housekeeping on the project.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 401 Unauthorized (invalid or missing authentication), 404 Not Found (project ID does not exist), and 403 Forbidden (insufficient permissions). Resolving these involves correcting credentials, project ID, or user permissions.

Links

Discussion