GitLab API

GitlabTool

Actions905

Overview

This node operation downloads job artifacts from a specific project in GitLab using the GitLab API. It is useful for automating the retrieval of build or test artifacts generated by CI/CD jobs in GitLab projects. For example, it can be used to fetch compiled binaries, test reports, or deployment packages from a particular branch or tag of a project.

Use Case Examples

  1. Download artifacts from a CI job named 'build' on the 'main' branch of a project with ID 12345.
  2. Fetch test result artifacts from a specific tag in a GitLab project for further analysis.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, default is GET.
Parameter Schema Defines required path and query parameters for the API call, including project ID, branch/tag name, job name, and optional job token.
Query Parameters Additional query parameters for the request, including the job name and optional job token for multi-project pipelines.
Path Parameters Path parameters specifying the project ID and branch or tag name in the repository.

Output

JSON

  • artifact - The downloaded artifact file content or metadata returned from the API.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and branch/tag name are correctly specified and URL-encoded if necessary.
  • Verify that the job name matches an existing job in the specified project and branch/tag.
  • If using job_token, confirm that the GitLab tier supports multi-project pipeline triggers and the token is valid.
  • Check network connectivity and baseUrl correctness if the request fails to reach the GitLab instance.

Links

Discussion