Fix Gitea release creation: include created_at timestamp to work around Gitea bug where releases get epoch zero timestamp

This commit is contained in:
Laan Tungir
2026-07-16 16:10:00 -04:00
parent 5744b83288
commit 09f3ec2f7c
2 changed files with 10 additions and 3 deletions

View File

@@ -219,15 +219,22 @@ create_gitea_release() {
token=$(cat "$HOME/.gitea_token" | tr -d '\n\r')
local api_url="https://git.laantungir.net/api/v1/repos/laantungir/n_signer"
# Include created_at timestamp to work around Gitea bug where releases
# created without a timestamp get epoch zero and don't appear in the
# releases list or web UI.
local now_iso
now_iso=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
local response
response=$(curl -s -X POST "$api_url/releases" \
-H "Authorization: token $token" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"$NEW_VERSION\", \"name\": \"$NEW_VERSION\", \"body\": \"$COMMIT_MESSAGE\"}")
-d "{\"tag_name\": \"$NEW_VERSION\", \"target_commitish\": \"master\", \"name\": \"$NEW_VERSION\", \"body\": \"$COMMIT_MESSAGE\", \"draft\": false, \"prerelease\": false, \"created_at\": \"$now_iso\"}")
if echo "$response" | grep -q '"id"'; then
echo "$response" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2
else
print_error "Failed to create Gitea release: $response"
return 1
fi
}