fix(release): fetch file SHAs from base branch, not next-release #24

Merged
argoyle merged 1 commits from fix-release-fetch-sha-from-base into main 2026-05-13 11:10:46 +00:00

1 Commits

Author SHA1 Message Date
argoyle e07c8412f0 fix(release): fetch file SHAs from base branch, not next-release
After POST /branches reports 201 and GET /branches/next-release reports
200, the /contents/{path}?ref=next-release endpoint can still 500 or
404 transiently while Gitea finishes indexing the new branch. That
caused fetch_sha to return empty for files that actually existed on
base, so write_file fell back to POST (create) and got HTTP 422
"repository file already exists" five times before giving up.

Query base branch for the blob SHA instead. Base is stable, and Gitea
content writes are content-addressed by blob SHA, so a SHA fetched from
main works for PUT on next-release (next-release was just forked from
main, so the blob is identical). Treat 404 as "file absent" and retry
other non-200 responses up to 5 times.
2026-05-13 13:09:02 +02:00