GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves the distribution tags of a specific npm package from the GitLab API (version 4). It is useful for scenarios where you need to get metadata about npm packages hosted on GitLab, such as the latest version tags or other version labels associated with the package. For example, developers or CI/CD pipelines can use this to verify package versions before deployment or integration.

Use Case Examples

  1. Fetch the dist-tags of an npm package named 'my-package' to check its latest version.
  2. Use in automation workflows to monitor package version changes in a GitLab repository.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication when making the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET. Options include GET, POST, PUT, DELETE, HEAD, PATCH.
Query Parameters Parameters sent as query string in the API request. Includes 'package_name' which is required to specify the npm package name to query.

Output

JSON

  • dist-tags - The distribution tags of the npm package, such as 'latest' or other version tags.
  • package_name - The name of the npm package queried.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the 'package_name' query parameter is provided and correctly spelled; missing or incorrect package names will cause API errors.
  • If authentication is enabled, verify that the GitLab API key credential is valid and has sufficient permissions to access the package information.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure it is correct and accessible.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (package does not exist), and 400 Bad Request (invalid parameters).

Links

Discussion