Skip to content

Latest commit

 

History

History
99 lines (77 loc) · 1.9 KB

configuration.md

File metadata and controls

99 lines (77 loc) · 1.9 KB

Configuration

Out of the box, release-it has sane defaults, and plenty of options to configure it.

Put only the options to override in a configuration file. Here is a list of file names where release-it looks for configuration in the root of the project:

  • .release-it.json
  • .release-it.ts
  • .release-it.js (or .cjs; export the configuration object: module.exports = {})
  • .release-it.yaml (or .yml)
  • .release-it.toml
  • package.json (in the release-it property)

Use --config path/release-it.json to use another configuration file location.

An example .release-it.json:

{
  "$schema": "https://unpkg.com/release-it@17/schema/release-it.json",
  "git": {
    "commitMessage": "chore: release v${version}"
  },
  "github": {
    "release": true
  }
}

The configuration can also be stored in a release-it property in package.json:

{
  "name": "my-package",
  "devDependencies": {
    "release-it": "*"
  },
  "release-it": {
    "github": {
      "release": true
    }
  }
}

Typescript config files are supported, providing typing hints to the config:

import type { Config } from 'release-it';

export default {
  git: {
    commit: true,
    tag: true,
    push: true
  },
  github: {
    release: true
  },
  npm: {
    publish: true
  }
} satisfies Config;

Or, use YAML in .release-it.yml:

git:
  requireCleanWorkingDir: false

TOML is also supported in .release-it.toml:

[hooks]
"before:init" = "npm test"

Any option can also be set on the command-line, and will have highest priority. Example:

release-it minor --git.requireBranch=main --github.release

Boolean arguments can be negated by using the no- prefix:

release-it --no-npm.publish

Also plugin options can be set from the command line:

release-it --no-plugins.@release-it/keep-a-changelog.strictLatest