GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retrieves the distribution tags of a specific npm package within a GitLab project using the GitLab API v4. It is useful for developers and DevOps engineers who want to programmatically access package metadata, such as version tags, for npm packages hosted in GitLab projects. For example, it can be used to automate version checks or integrate package information into CI/CD pipelines.

Use Case Examples

  1. Fetch the dist-tags of an npm package named 'my-package' in a project with ID '12345' to verify the latest published versions.
  2. Use the retrieved dist-tags to trigger deployment workflows based on specific package versions.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request (boolean). Defaults to false.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET.
Query Parameters Query parameters for the API request, specifically the package_name which is the name of the npm package to query.
Path Parameters Path parameters for the API request, specifically the id which is the ID or URL-encoded path of the GitLab project.

Output

JSON

  • dist-tags - The distribution tags of the npm package, typically including tags like 'latest' pointing to specific package versions.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

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

Links

Discussion