Skip to content
Shipcheck

Reference

Configuration

Shipcheck works without configuration. When you need to change something, add a .shipcheck.yml to the project root.

Shipcheck looks for .shipcheck.yml (or .shipcheck.yaml) in the directory being checked. Use --config path/to/file.yml to load a different file. Run shipcheck init to generate a commented starting point.

.shipcheck.yml
version: 1checks:  tests: true  build: true  environment: true  readme: true  license: false  ci: false  git_clean: trueseverity:  version: error   # a stale version blocks shipping  readme: warngit:  protected_branches:    - main    - masterenvironment:  required:    - DATABASE_URL    - API_KEY  files:    - .env    - .env.localcommands:  tests: npm run test:ci  build:    - npm run build    - go build ./...  timeout: 10m

version

The config format version. Currently 1. Required so that future formats can change without breaking existing files.

checks

Turn checks on or off. Every check is on by default, and disabled checks don't appear in the report. Keys use underscores; the dotted IDs from the JSON output (git.clean) are accepted too.

KeyCheck
git_repoGit repository
git_cleanWorking tree
git_branchBranch
testsTests
buildProduction build
environmentEnvironment
readmeREADME
licenseLicense
versionVersion
ciCI

severity

Change how a check's problems are reported, without turning it off.

  • error turns warnings into failures. Use it for things you want to enforce, such as ci: error.
  • warn turns failures into warnings. The problem is still shown, but doesn't block shipping, for example git_clean: warn while you iterate.

Passing and skipped checks are unaffected. warning is accepted as an alias for warn.

yaml
severity:  ci: error        # require CI  license: error   # require a license  git_clean: warn  # allow uncommitted changes

git

protected_branches lists the branches you ship from. The branch check warns when you run Shipcheck on any other branch. Without this setting, Shipcheck uses main or master if either exists.

yaml
git:  protected_branches:    - main    - release

environment

Variables listed in .env.example, .env.sample or .example.env are required automatically. Use required to add more. Each must have a non-empty value in the process environment or in one of files (default: .env).

yaml
environment:  required:    - DATABASE_URL    - STRIPE_SECRET_KEY  files:    - .env    - .env.production

Names must be valid variable names (A-Z, 0-9, _). Files must be relative paths inside the project. Values are never printed.

commands

Override the detected test and build commands. Each can be a single command or a list; commands in a list run in order and stop at the first failure. timeout applies to each command (default 10m).

yaml
commands:  tests:    - go -C api test ./...    - npm --prefix web test  build: make release  timeout: 15m

Found a mistake? Edit this page on GitHub