---
myst:
  html_meta:
    "description": "The exit codes of repoplone commands, and the situations that produce each one."
    "property=og:description": "The exit codes of repoplone commands, and the situations that produce each one."
    "property=og:title": "Exit codes"
    "keywords": "Plone, repoplone, exit codes, errors, CI"
---

(reference-exit-codes)=

# Exit codes

This page lists the exit codes of repoplone commands.
repoplone exits with code 0 on success and 1 on failure.
A known error prints `Error: <message>` to the standard error.

(reference-exit-codes-zero)=

## Exit code 0

<!-- source: src/repoplone/cli.py, src/repoplone/utils/display.py, src/repoplone/commands/ -->

| Command | Situation |
|---|---|
| any | Success. |
| any | No `repository.toml` was found. The command prints `Did not find a repository.toml file.` |
| any | You answered no to a confirmation. |
| `release` | You answered no after a warning in the checks before the release. |
| `deps upgrade` | The component already uses the requested version. |
| `deps constraints` | The backend is not managed by uv. The command prints a message and changes nothing. |

```{important}
A missing `repository.toml` is not a failure.
In CI, check that the file exists before you rely on the exit code.
```

(reference-exit-codes-one)=

## Exit code 1

<!-- source: src/repoplone/commands/release.py, src/repoplone/commands/settings.py, src/repoplone/commands/changelog.py, src/repoplone/commands/dependencies/__init__.py -->

| Command | Situation |
|---|---|
| any | `repository.toml` is not valid. |
| `release` | PyPI or npm authentication is missing for a package with `publish = true`. |
| `release` | The repository changelog is missing, or has no `<!-- towncrier release notes start -->` line. |
| `release` | A tracked file has uncommitted changes, outside a dry run and a restart. |
| `release` | `--start-step` names an unknown step. |
| `release` | The version is not valid, is not higher than the current one, or already exists as a tag. |
| `release` | `--start-step` skips `version`, and no version was given. |
| `release` | A step failed. The command prints `Release failed:` and the reason. |
| `settings sanity-check` | A `local_step` entrypoint cannot be imported. |
| `settings migrate` | The file cannot be migrated, or already follows specification 2. |
| `settings migrate --components` | The file already declares components, or `--path` was given too. |
| `changelog check` | An area has changes and no news fragment. |
| `changelog check` | The branch cannot be compared with the base, or both `--json` and `--github` were given. |
| `deps` | The component is unknown, has no base package, or the version is not valid for it. |
| `deps upgrade`, `deps sync` | The upgrade or `make <component>-install` failed. |
| `deps stamp-volto-version` | `mrs.developer.json` has no `@plone/volto` tag, or the package has no `package.json`. |

```{seealso}
- {doc}`cli`, for every command and option.
- {doc}`/how-to/check-news-in-ci`, which relies on the exit code of `changelog check`.
```
