GitLab API icon

GitLab API

Gitlab

Actions917

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 project's package registry on GitLab. For example, it can be used in CI/CD pipelines to fetch package files for deployment or analysis.

Use Case Examples

  1. Fetch a specific npm package file from a GitLab project to verify its contents before deployment.
  2. Automate the retrieval of package files for backup or auditing purposes.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication when making the API request.
Authentication Specifies the authentication method to use, typically an API key credential for GitLab.
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.
Query Parameters Parameters sent in the query string to specify the package name and file name to retrieve.
Path Parameters Parameters sent in the URL path to specify the project ID or URL-encoded path.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • package_name - The name of the npm package retrieved.
  • file_name - The name of the package file retrieved.
  • content - The content or metadata of the retrieved npm package file.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and package/file names are correctly URL-encoded and valid.
  • Verify that the authentication token has sufficient permissions to access the project's package registry.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common errors include 404 Not Found if the project or package file does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion