GitLab API

GitlabTool

Actions905

Overview

This node operation is designed to keep artifacts from a specific job in a GitLab project. It sends a POST request to the GitLab API endpoint `/api/v4/projects/{id}/jobs/{job_id}/artifacts/keep`, which prevents the artifacts of the specified job from being deleted. This is useful in CI/CD pipelines where you want to preserve build artifacts for later use or inspection.

Use Case Examples

  1. In a CI/CD workflow, after a job completes successfully, use this node to keep the job's artifacts so they can be downloaded or used in subsequent jobs.
  2. In a project management automation, keep artifacts of important jobs to ensure they are archived and accessible for auditing or debugging.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
Authentication Type of authentication used for the API request, 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 POST for this operation.
Path Parameters Parameters required in the request path to identify the project and job whose artifacts are to be kept.

Output

JSON

  • response - The JSON response from the GitLab API confirming the artifacts are kept or providing relevant job artifact details.

Dependencies

  • Requires GitLab API key credential for authentication unless skipping authentication is enabled.

Troubleshooting

  • Ensure the project ID and job ID are correct and exist in the GitLab instance to avoid 404 errors.
  • If authentication is enabled, verify that the API key has sufficient permissions to access job artifacts.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure the URL is correct.
  • Common error messages include '401 Unauthorized' if authentication fails, and '404 Not Found' if the project or job does not exist.

Links

Discussion