GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves the distribution tags of a specific npm package within a GitLab project using the GitLab API. It is useful for developers or DevOps engineers who want to programmatically access metadata about npm packages hosted in GitLab projects, such as checking available version tags or managing package versions.

Use Case Examples

  1. A developer wants to fetch the dist-tags of an npm package named 'my-package' in a project with ID '12345' to verify the latest published versions.
  2. A CI/CD pipeline step retrieves npm package dist-tags to decide if a new version needs to be published.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for 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 to which the API request is sent.
Method The HTTP method used for the API request, default is GET.
Query Parameters Query parameters for the API request, specifically the npm package name to retrieve dist-tags for.
Path Parameters Path parameters for the API request, specifically the project ID or URL-encoded path.

Output

JSON

  • distTags - The distribution tags of the npm package retrieved from the GitLab project, typically including tags like 'latest' and other version tags.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and package name are correctly URL-encoded and valid to avoid 404 errors.
  • If authentication is enabled, verify that the API token has sufficient permissions to access the project's package registry.
  • Check the baseUrl is correctly set to the GitLab instance URL if using a self-hosted GitLab server.
  • Common error messages include '404 Not Found' if the project or package does not exist, and '401 Unauthorized' if authentication fails.

Links

Discussion