docs/configuration.md
Out of the box, release-it has sane defaults. See the configuration 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.tomlpackage.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@20/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"
Release-it has plenty of options. See the following tables for plugin configuration options:
You can extend a configuration from a remote source using the extends option. The following formats are supported:
github:owner/repo: Get the config from the default branch (main) in the repo at Github.github:owner/repo#tag: Get the config from the specified tag in the repo at Github.github:owner/repo:subdir#tag: Get the config from the specified tag in the repo sub dir at Github.And support other schema, either gitlab:, bitbucket:, or https:.
For example, to extend a configuration from a GitHub repository:
{
"$schema": "https://unpkg.com/release-it@20/schema/release-it.json",
"extends": "github:release-it/release-it-configuration"
}
Get more information at c12 documents.
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