GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves information about 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 package details stored in a GitLab project's npm registry. For example, it can be used to automate package version checks or integrate package data into CI/CD pipelines.

Use Case Examples

  1. Fetch details of an npm package named 'mypackage' from a GitLab project with a specific project ID.
  2. Automate monitoring of npm package metadata within GitLab projects for dependency management.

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, 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, specifically the npm package name to retrieve.
Path Parameters Parameters sent in the URL path, specifically the project ID or URL-encoded path.

Output

JSON

  • id - The ID of the npm package in the GitLab project.
  • name - The name of the npm package.
  • version - The version of the npm package.
  • created_at - Timestamp when the package was created.
  • updated_at - Timestamp when the package was last updated.
  • project_id - The ID of the GitLab project containing the package.
  • package_type - The type of package, here it is npm.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and package name are correctly URL-encoded and valid.
  • Verify that the GitLab API token has sufficient permissions to access the project's npm packages.
  • Check the base URL if using a self-hosted GitLab instance instead of gitlab.com.
  • Common error: 404 Not Found - The project or package does not exist or is not accessible with the provided credentials.
  • Common error: 401 Unauthorized - Authentication failed, check API token or skipAuthentication setting.

Links

Discussion