Skip to content

A Semantic Release plugin to update versions in OpenAPI / Swagger specification files

License

Notifications You must be signed in to change notification settings

aensley/semantic-release-openapi

semantic-release-openapi

npm npm types license npm downloads

ci Maintainability Test Coverage

A Semantic Release plugin to update versions in OpenAPI / Swagger specification files.

Installation

This module is distributed via npm and should be installed as one of your project's devDependencies:

npm install --save-dev semantic-release-openapi

Usage

Plugin Config

This plugin has one configuration option which must be supplied.

  • apiSpecFiles: An array of OpenAPI / Swagger specification file paths. Glob patterns (e.g. '*.yaml') are supported.

    All matching files must have a .json, .yaml, or .yml extension.

Committing Changes

IMPORTANT: Semantic Release will not commit changes to your OpenAPI spec files unless you add the same files in assets for the @semantic-release/git plugin! See the example below.

Example

{
  "release": {
    "plugins": [
      [
        "semantic-release-openapi",
        {
          "apiSpecFiles": ["openapi.yaml", "src/swagger-*.json"]
        }
      ],
      [
        "@semantic-release/git",
        {
          "assets": ["package.json", "openapi.yaml", "src/swagger-*.json"]
        }
      ]
    ]
  }
}

About

A Semantic Release plugin to update versions in OpenAPI / Swagger specification files

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

  •