# `mix phoenix_kit.release_check`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.165/lib/mix/tasks/phoenix_kit.release_check.ex#L1)

Asserts release-metadata consistency before publishing to Hex.

Catches the class of mistakes that `precommit`/`quality.ci` cannot see —
version/CHANGELOG/migration drift and unsafe git state — and exits non-zero
on any failure so it can gate `mix hex.publish`. It is the semantic core of
the `mix prerelease` alias and runs without a database.

## Usage

    $ mix phoenix_kit.release_check
    $ mix phoenix_kit.release_check --allow-dirty --allow-branch

## Options

  * `--allow-dirty`  — downgrade the "working tree clean" check to a warning
  * `--allow-branch` — downgrade the "on main branch" check to a warning

## Checks Performed

  1. **CHANGELOG Heading** — top `## X.Y.Z` entry matches `mix.exs` `@version`
     (and is a real version, not "Unreleased").
  2. **CHANGELOG Body** — that entry has at least one content line.
  3. **Migration Version Sync** — `Migrations.Postgres.current_version/0`
     equals the highest `vNNN.ex` migration file on disk.
  4. **Git Tree Clean** — no uncommitted changes (`--allow-dirty` to warn).
  5. **Git Branch** — on `main` (`--allow-branch` to warn).
  6. **Tag Collision** — tag `v<version>` does not already exist (publish-
     before-tag means a pre-existing tag signals a double release).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
