GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves a specific npm package file from a GitLab project using the GitLab API. It is useful for automating the download or inspection of npm package files stored within a GitLab project's package registry. For example, it can be used in CI/CD pipelines to fetch package files for deployment or analysis.

Use Case Examples

  1. Fetch the 'package.json' file of a specific npm package from a GitLab project to verify its contents before deployment.
  2. Download a specific version of an npm package file from a GitLab project for integration testing.

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 for GitLab.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the request, default is GET.
Query Parameters Query parameters for the request including package_name (the npm package name) and file_name (the specific package file name).
Path Parameters Path parameters for the request including id (the ID or URL-encoded path of the GitLab project).

Output

JSON

  • response - The JSON response containing the requested npm package file data from the GitLab project.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID or path is correct and URL-encoded if necessary to avoid 404 errors.
  • Verify that the package_name and file_name query parameters are correctly specified and exist in the project to prevent errors.
  • Check that the authentication token has sufficient permissions to access the project's package registry.
  • If skipping authentication, ensure the GitLab instance allows unauthenticated access to the package files, otherwise the request will fail.

Links

Discussion