GitLab API icon

GitLab API

Gitlab

Actions1062

Npm_packages → putApiV4ProjectsIdPackagesNpmPackage*packageNameDistTagsTag

AI-generated

Summary

Update the dist-tag of a specific NPM package in a GitLab project by setting or changing the tag to point to a particular package version.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project that contains the NPM package.
  • package_name (required) — The name of the NPM package to update (in the path as a wildcard segment).
  • tag (required) — The distribution tag of the NPM package to update (e.g., 'latest').
  • request body (required) — The body must include the payload as defined by GitLab's API schema for updating the dist-tag of an NPM package, typically specifying the version the tag should point to.
  • skipAuthentication — Boolean to optionally skip authentication on the request.
  • baseUrl — The base URL for the GitLab instance; defaults to https://gitlab.com if not overridden.

Output shape

a single JSON object representing the updated dist-tag resource returned from the GitLab API

The response shape aligns with GitLab's API response for this endpoint. Authentication is required unless explicitly skipped. The operation uses HTTP PUT to update the dist-tag.

Examples

Example 1: Update the 'latest' dist-tag of the NPM package 'my-package' in project with ID '123' to point to version '1.2.3'.

Set 'id' to '123', 'package_name' to 'my-package' (through the path wildcard), 'tag' to 'latest', and provide the request body with the version reference (e.g., {"version": "1.2.3"}). Use credential 'gitlabApi' for authentication.

Links

Discussion