Configuration

Shipnotes reads .shipnotes.yml in the project root. Every key is optional. Without the file, Shipnotes uses the defaults on this page. The Command reference explains how a command finds the root.

This example configures a Rails app with an app surface and an api surface:

fields:
  title: { type: string, required: true, description: One line that names the change }
  kind: { type: enum, required: true, values: [added, changed, deprecated, removed, fixed, security] }
  body: { type: text, description: Details for the reader }
  audience: { type: enum, values: [public, internal], default: public }
  flag: { type: string, description: Feature flag that hides the change }

surfaces:
  app:
    title: Product updates
    paths: [app/views/**, app/javascript/**, config/routes.rb]
    exclude: [app/views/admin/**]
  api:
    title: API changes
    paths: [app/controllers/api/**]
    contract: { file: openapi.json, differ: openapi }

triggers:
  - name: feature flag
    pattern: 'Flipper\.enabled\?\('
    paths: [app, config]
    surface: app

versioning:
  release_id: date

publication:
  audience_field: audience
  flag_field: flag

How the file is read

  • The file must be a YAML mapping. An unknown top-level key is an error: unknown keys in .shipnotes.yml: NAME.
  • A top-level key that you set replaces its default completely. For example, a fields key replaces the three default fields.
  • check, versioning, render and publication merge one level deep. A key that you set inside them replaces that key’s default. The other keys keep their defaults.
  • Every command loads the file first. A configuration error stops the command with shipnotes: MESSAGE and exit status 1.

The top-level keys are directory, fields, rules, surfaces, triggers, check, versioning, render, publication and require.

directory

The folder that holds the changelog files, relative to the root.

Default Allowed values
changelog A non-empty string. A trailing / is removed.

Entries go in DIRECTORY/unreleased/ and releases go in DIRECTORY/releases/. Error: directory must be a string.

fields

The entry schema. Each key is a field name. Each value is a mapping of options.

fields:
  title: { type: string, required: true, description: One line that names the change }
  kind: { type: enum, required: true, values: [added, changed, deprecated, removed, fixed, security] }
  compatibility: { type: enum, required: true, values: [additive, compatible_fix, breaking, none] }
  audience: { type: enum, values: [public, internal], default: public }
  action: { type: string }
  sunset: { type: date }
  platforms: { type: list, values: [web, ios, android] }
  beta: { type: boolean }

The default is the Keep a Changelog schema: title, kind and body. See Writing entries.

Field options

Option Default Meaning
type string One of the types below.
required false Only the value true makes the field required.
values none The allowed values. Required for enum. Optional for list, where it limits the items.
default none The value that shipnotes new uses when you do not give one. The publication rules also use the default of the audience field.
description none Shown in the shipnotes new prompt and in its --help text.

Field types

Type A valid value shipnotes new input
string A string The text, stripped
text A string, usually several lines The text, stripped
enum One string from values The value, or its position in the list at a prompt
list A non-empty list of strings with no repeated item; each item in values when values is set Comma-separated values
date A YYYY-MM-DD date YYYY-MM-DD
boolean true or false true, yes, y or 1 for true; any other text for false

Reserved names

id, surfaces and bump are reserved. Shipnotes takes the id from the file name. It adds surfaces when surfaces are configured and adds bump to every schema. See Fields that Shipnotes adds.

Errors

Message Cause
fields must be a mapping fields is not a mapping, or it is empty.
field NAME is reserved The name is id, surfaces or bump.
field NAME must be a mapping The field’s options are not a mapping.
field NAME has a bad name; use lowercase letters, digits and _ The name must start with a lowercase letter.
field NAME has unknown options: OPTION An option is not in the table above.
field NAME type must be one of string, text, enum, list, date, boolean The type is not known.
field NAME is an enum and needs values An enum has no values.

rules

Conditional requirements. A rule applies when every field in when has one of the listed values. It then requires the fields in require and rejects the values in reject.

rules:
  - when: { kind: deprecated }
    require: [sunset]
  - when: { compatibility: breaking }
    require: [action]
    reject: { action: [none] }
    message: a breaking change needs a real action for integrators
Key Default Meaning
when {} Field name to a value or a list of values. A list field matches when it holds any of the values. An empty when always matches.
require [] Fields that must not be empty when the rule applies.
reject {} Field name to values that the field must not have when the rule applies.
message none One message that replaces the rule’s own errors.

Without message, the errors look like sunset is required when kind deprecated and action cannot be "none" when compatibility breaking.

Errors: rules must be a list, rules[N] must be a mapping, rules[N] has unknown keys: KEY, rules[N].when must be a mapping, rules[N].reject must be a mapping, rules[N] names unknown fields: NAME.

surfaces

The parts of your project that users see, such as your app or your API. Each surface lists the paths that belong to it. A change to those paths needs an entry for that surface. See Pull request check.

surfaces:
  app:
    title: Product updates
    description: Pages, routes and anything a signed-in user sees.
    paths: [app/views/**, app/javascript/**, config/routes.rb]
    exclude: [app/views/admin/**]
  api:
    title: API changes
    paths: [app/controllers/api/**]
    contract: { file: openapi.json, differ: openapi }
Key Default Meaning
title The key with _ and - changed to spaces, first letter capitalized The heading in the Rails engine.
description none The text under the heading in the Rails engine.
paths [] Path globs that belong to the surface.
exclude [] Path globs that do not belong to the surface, even when paths matches.
contract none { file:, differ: }. A contract file whose breaking changes need a major entry. See Contracts and differs.

The default is {}, which means no surfaces. A surface with no options (app:) is allowed.

When you configure surfaces, every entry must have a surfaces list. The surface keys are its allowed values.

Path globs

Paths are relative to the root.

  • A path without *, ?, [ or { matches that file, or anything under that folder. config/routes.rb matches one file. app matches everything under app/.
  • A glob that ends in /** matches everything below that folder, at any depth.
  • * does not cross a /. **/ matches zero or more folders. {a,b} matches either alternative.
  • A leading ./ is ignored.
  • A surface’s contract file always belongs to the surface, even without a paths match.

Reserved key and errors

The key all is reserved, because the Rails engine uses /all for the page with every surface.

Errors: surfaces must be a mapping, surface KEY needs a lowercase slug key (use a-z, 0-9, _ and -, starting with a letter or digit), surface key all is reserved, surface KEY must be a mapping, surface KEY has unknown keys: NAME, surface KEY contract needs file and differ.

triggers

Regular expressions that make a change need an entry, whatever the path. For example, a new feature flag needs an entry.

triggers:
  - name: feature flag
    pattern: 'Flipper\.enabled\?\('
    paths: [app, config]
    surface: app
Key Default Meaning
pattern required A Ruby regular expression. The check runs it on the added and removed lines of the diff.
name trigger N The name in the check output.
paths [] Path globs to search. Empty means every changed file.
surface none The surface that the entry must include. Without it, any new entry satisfies the trigger.

Use single quotes in YAML for a pattern that contains \.

Errors: triggers must be a list, triggers[N] needs a pattern, triggers[N] names unknown surface KEY, triggers[N].pattern is not a valid regular expression: ....

check

Settings for the entry rule of shipnotes check.

check:
  require_entry: auto
  ignore: [test/**, "**/*.md", .github/**]
Key Default Allowed values
require_entry auto auto, always or surfaces
ignore [] Path globs
  • surfaces: a change needs an entry only when it touches a surface. It is an error if no surfaces are configured.
  • always: every change needs an entry, except a change in which every file matches ignore.
  • auto: surfaces when surfaces are configured, otherwise always.

ignore applies only to always. Files under the changelog directory never count. "*.md" matches Markdown files in the root only. Use "**/*.md" to match them in every folder.

Errors: check must be a mapping, check.require_entry must be auto, always or surfaces, check.require_entry is surfaces, but no surfaces are configured.

versioning

How releases are named and how the version moves. Versioning explains the rules in detail.

versioning:
  scheme: semver
  release_id: version
  initial: 0.0.0
  bump:
    field: compatibility
    levels: { breaking: major, additive: minor, compatible_fix: patch }
    surfaces: [api]
  files:
    - { path: lib/acme_widgets/version.rb, pattern: 'VERSION = "(?<version>[^"]+)"' }
    - { path: package.json, json: version }
    - { path: openapi.json, json: info.version }
Key Default Allowed values
scheme semver semver or none. With none, releases have no version.
release_id version version names a release 1.4.0. date names it 2026.12.01.1. none requires date.
initial 0.0.0 A MAJOR.MINOR.PATCH version. The current version when there is no release and no version file.
bump.field kind The field whose value decides the bump.
bump.levels see below Field value to major, minor, patch or none.
bump.surfaces none Only entries on these surfaces bump the version.
files [] Version files that release writes and check verifies.

The default levels are removed: major, added: minor, changed: minor, deprecated: minor, fixed: patch and security: patch.

bump replaces its default completely. When you set bump, set field and levels together. A value that is not in levels does not bump.

If you replace fields and your schema has no kind field, the default bump field is dropped and no entry bumps the version. If you set bump.field to a field that does not exist, that is an error.

Version files

Each item in files needs a path and exactly one of pattern or json.

  • pattern is a Ruby regular expression. The named group version holds the version. Without named groups, the first capture group holds it. The pattern must match exactly once when release writes the file.
  • json is a dot-separated path into a JSON document, such as version or info.version.

Errors

Message Cause
versioning must be a mapping versioning is not a mapping.
versioning.scheme must be semver or none Unknown scheme.
versioning.release_id must be version or date Unknown release id.
versioning.release_id must be date when scheme is none A project without versions cannot name releases by version.
versioning.initial must be a MAJOR.MINOR.PATCH version initial is not a valid version.
versioning.bump.levels must map values to major, minor, patch or none A level is not known.
versioning.bump.field names unknown field NAME bump.field is not in fields.
versioning.bump.surfaces names unknown surfaces: KEY A surface key is not configured.
versioning.files[N] needs a path An item has no path.
versioning.files[N] needs exactly one of pattern or json An item has both or neither.
versioning.files[N].pattern needs a (?<version>...) group The pattern has no version group and no capture group.
versioning.files[N].pattern is not a valid regular expression: ... The pattern does not compile.

render

How CHANGELOG.md and the release notes are written. Releasing describes the render command.

render:
  output: CHANGELOG.md
  template: config/changelog.md.erb
  title: Changelog
  group_by: kind
  headings: { security: Security fixes }
  details: [body]
Key Default Meaning
output CHANGELOG.md The file that release and render write. Set null to write no file.
template none An ERB template for the changelog file, relative to the root. See Custom templates.
title Changelog The top heading.
group_by kind The field that groups entries under headings. Headings follow the order of the field’s values. Values not in that list come last, in alphabetical order.
headings {} Field value to heading text. Without an item, the heading is the value with _ and - changed to spaces, first letter capitalized.
details [body] Fields shown under each entry title. Names that are not in fields are ignored.

If your schema has no kind field, the default group_by is dropped and entries are not grouped. Errors: render must be a mapping, render.group_by names unknown field NAME.

The template applies to the changelog file only. shipnotes notes always uses the built-in release notes layout.

publication

Which entries are public. These rules apply to CHANGELOG.md, shipnotes notes and the Rails engine.

publication:
  audience_field: audience
  public_values: [public]
  flag_field: flag
Key Default Meaning
audience_field none The field that decides who can see an entry. Without it, every entry is public.
public_values [public] The audience values that are public.
flag_field none The field that names a feature flag. The Rails engine marks an entry whose flag is off as “Coming soon”.

An entry without an audience value takes the field’s default. Without a default, the entry is not public. A release with no public entry does not appear.

Errors: publication must be a mapping, publication.audience_field names unknown field NAME, publication.flag_field names unknown field NAME.

require

Ruby files that define custom differs, relative to the root.

require: [lib/acme/graphql_differ.rb]

The default is []. Shipnotes loads these files only when the check needs a differ that is not built in. Error: require must be a string for an item that is not a non-empty string.