Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

semantic-release-replace-plugin

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semantic-release-replace-plugin

Semantic Release Replace Plugin

  • 1.2.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Semantic Release Replace Plugin

npm Build Release codecov GitHub contributors semantic-release

The semantic-release-replace-plugin plugin provides functionality to update version strings throughout a project. This enables semantic release to be used in many different languages and build processes.

Read more about Semantic Release.

Install

$ npm install semantic-release-replace-plugin -D

Usage

The following example uses this plugin to demonstrate using semantic-release in a Python package where __VERSION__ is defined in the root __init__.py file.

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    [
      "semantic-release-replace-plugin",
      {
        "replacements": [
          {
            "files": ["foo/__init__.py"],
            "from": "__VERSION__ = \".*\"",
            "to": "__VERSION__ = \"${nextRelease.version}\"",
            "results": [
              {
                "file": "foo/__init__.py",
                "hasChanged": true,
                "numMatches": 1,
                "numReplacements": 1
              }
            ],
            "countMatches": true
          }
        ]
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": ["foo/*.py"]
      }
    ]
  ]
}

Validation

The presence of the results array will trigger validation that a replacement has been made. This is optional but recommended.

Warning

This plugin will not commit changes unless you specify assets for the @semantic-release/git plugin! This is highlighted below.

[
  "@semantic-release/git",
  {
    "assets": ["foo/*.py"]
  }
]

Options

Please refer to the documentation for more options.

Keywords

FAQs

Package last updated on 20 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc