GitLab API

GitlabTool

Actions1000

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 the latest 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 current version tags before publishing a new version.
  2. A CI/CD pipeline step that checks the dist-tags of an npm package in a GitLab project to decide whether to trigger a deployment based on the package version.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making the API request.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Query Parameters Query parameters for the API request, specifically the npm package name.
Path Parameters Path parameters for the API request, specifically the project ID.

Output

JSON

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

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the project ID and package name are correctly URL-encoded and valid.
  • Verify that the GitLab API credentials are correctly configured and have the necessary permissions to access the project and package data.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages may include 401 Unauthorized if authentication fails, 404 Not Found if the project or package does not exist, and 400 Bad Request if parameters are missing or malformed.

Links

Discussion