Files
legacy-email-proxy/.gitea
lyrathorpeandEmma Thorpe efa76ce17b fix: do not fail the release when pyproject.toml is already current (#18)
## The defect

The release step added in #17 commits the computed version unconditionally:

```sh
git add pyproject.toml
git commit -m "chore(release): v${VERSION}"
```

If `pyproject.toml` already carries that version — a re-run of a release, or a version corrected by hand — nothing is staged, `git commit` exits non-zero, and `set -euo pipefail` fails the job. By that point the image has already been pushed, so the release is half-done: published container, no tag. The next run then computes the same version again from the same commits.

## The fix

Skip the commit and its branch push when there is nothing staged; tag either way.

## Verification

The step was extracted from the workflow and run against a scratch repository with a real `origin`:

- `VERSION` equal to the file's version → logs `pyproject.toml is already at 0.1.0`, pushes the tag, no commit.
- `VERSION` different → commits `chore(release): v0.2.0`, pushes the branch, then the tag.

Both paths leave `main` and the tags consistent. `bash -n` clean.

Found while porting this same release scheme to `music-mirror`, which carries the guarded version from the start.

---------

Co-authored-by: Emma Thorpe <emma.thorpe@citrix.com>
Reviewed-on: #18
2026-08-21 14:50:08 +01:00
..