npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gitlab/semantic-release-merge-request-analyzer

v1.3.0

Published

Semantic release plugin to determine version based on GitLab merge request labels

Readme

semantic-release-merge-request-analyzer

A semantic-release plugin that determines the next version based on GitLab merge request labels and generates release notes from merge request information.

Features

  • Determines version bump (major, minor, patch, etc.) based on GitLab merge request labels
  • Supports all semantic-release version types: major, premajor, minor, preminor, patch, prepatch, prerelease
  • Fully customizable label mapping for determining release types
  • Generates structured release notes from merge request information
  • Integrates with GitLab CI/CD environment variables

Installation

npm install --save-dev "@gitlab/semantic-release-merge-request-analyzer"

Default Label Configuration

By default, this plugin recognizes the following labels:

  • breaking change - Triggers a major release
  • type::feature - Triggers a minor release
  • type::bug - Triggers a patch release
  • type::maintenance - Does not trigger a release (maintenance work)

However, you can fully customize which labels map to which release types.

Configuration

Environment Variables

The plugin requires the following environment variables:

  • CI_SERVER_URL: The base URL of the GitLab instance, including protocol and port (automatically set in GitLab CI, default: https://gitlab.com)
  • CI_PROJECT_ID: The GitLab project ID (automatically set in GitLab CI)
  • GITLAB_TOKEN: A GitLab access token with API access

semantic-release Configuration

Add the plugin to your .releaserc.json or release.config.js:

{
  "plugins": [
    "@gitlab/semantic-release-merge-request-analyzer",
    "@semantic-release/gitlab"
  ]
}

Custom Label Configuration

You can customize which labels trigger which release types:

{
  "plugins": [
    [
      "@gitlab/semantic-release-merge-request-analyzer",
      {
        "labels": {
          "major": ["breaking change", "breaking-change"],
          "premajor": ["pre-major"],
          "minor": ["type::feature", "feature", "feat"],
          "preminor": ["pre-minor"],
          "patch": ["type::bug", "bug", "fix"],
          "prepatch": ["pre-patch"],
          "prerelease": ["pre-release"]
        }
      }
    ],
    "@semantic-release/gitlab"
  ]
}

The plugin supports all standard semantic-release version types:

  • major - Backward-incompatible changes
  • premajor - Pre-release for the next major version
  • minor - New features (backward-compatible)
  • preminor - Pre-release for the next minor version
  • patch - Bug fixes
  • prepatch - Pre-release for the next patch version
  • prerelease - General pre-release

If a merge request has multiple labels that would trigger different release types, the plugin chooses the highest release type based on the precedence (major > premajor > minor > preminor > patch > prepatch > prerelease).

If a merge request doesn't have any of the configured labels, it won't trigger a release.

Function-Specific Configuration

Alternatively, if you want to use only specific functions from this plugin:

{
  "plugins": [
    [
      "@gitlab/semantic-release-merge-request-analyzer",
      {
        "analyzeCommits": true,
        "generateNotes": true,
        "labels": {
          "major": ["breaking"],
          "minor": ["feature"],
          "patch": ["fix"]
        }
      }
    ],
    "@semantic-release/gitlab"
  ]
}

How It Works

  1. Verify Conditions: Checks that required environment variables are present.
  2. Analyze Commits: For each commit, the plugin:
    • Finds the associated GitLab merge request
    • Examines the merge request labels to determine if a release is needed
    • Determines release type (major, minor, patch, etc.) based on configured label mapping
    • Selects the highest precedence release type among all analyzed merge requests
  3. Generate Notes: Creates structured release notes based on merge request titles, categorized by release type.

Release Type Precedence

When multiple merge requests with different release types are found, the plugin follows this precedence order:

  1. major (highest)
  2. premajor
  3. minor
  4. preminor
  5. patch
  6. prepatch
  7. prerelease (lowest)

This ensures that the most significant change determines the final release type.

License

MIT