fix(release): poll branch readiness before .version write #22
Reference in New Issue
Block a user
Delete Branch "fix-release-version-race"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Release workflow intermittently failed at the
.versionwrite step withexit 22and no diagnostic output. The CHANGELOG.md PUT creates thenext-releasebranch via thenew_branchparameter, then the.versionPUT fires ~2s later — racing Gitea's branch indexing. Because the call usedcurl -sf(fail-silent), 404/409 responses produced exit 22 with no body, leaving logs unhelpful.Changes
.versionis written..versionwrite with a 5-attempt retry loop that logs HTTP code and body on failure (same pattern already used for PR creation).Test plan
.versionwrite succeeds first try and PR is created.