fix(gitea): document and explain HTTP 422 repo is empty on release create

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Docker Build
2026-05-10 14:37:02 -05:00
parent 5e18c2b766
commit 27d54f15a2
2 changed files with 8 additions and 1 deletions
@@ -47,6 +47,12 @@ elif [ "$code" = "404" ]; then
if [ "$code" != "201" ] && [ "$code" != "200" ]; then
echo "Gitea create release failed HTTP $code:" >&2
cat "$REL_JSON" >&2
if [ "$code" = "422" ] && jq -e '.message == "repo is empty"' "$REL_JSON" >/dev/null 2>&1; then
echo >&2
echo "Gitea does not allow releases on a repo with zero commits. Fix: push at least one commit" >&2
echo "to ${GITEA_OWNER}/${GITEA_REPO} (e.g. add README.md on branch ${TARGET} via web UI or git push)," >&2
echo "or set Actions variable GITEA_TARGET_REF to an existing default branch name." >&2
fi
exit 1
fi
rel_id=$(jq -r '.id' "$REL_JSON")