From 2d51a3fa48961f4db00367cf60f0aba2f4f0de51 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 2 Sep 2023 08:57:24 +0200 Subject: [PATCH] workaround race condition in v1.20 Refs: https://codeberg.org/forgejo/forgejo/issues/1370 --- forgejo-release.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/forgejo-release.sh b/forgejo-release.sh index 437e605..54736c7 100755 --- a/forgejo-release.sh +++ b/forgejo-release.sh @@ -44,7 +44,16 @@ upload_release() { test ${releasetype+false} || echo "Uploading as Stable" ensure_tag anchor=$(echo $TAG | sed -e 's/^v//' -e 's/[^a-zA-Z0-9]/-/g') - $BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title $TAG --draft ${releasetype} + if ! $BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title $TAG --draft ${releasetype} >& $TMP_DIR/tea.log ; then + if grep --quiet 'Unknown API Error: 500' $TMP_DIR/tea.log && grep --quiet services/release/release.go:194 $TMP_DIR/tea.log ; then + echo "workaround v1.20 race condition https://codeberg.org/forgejo/forgejo/issues/1370" + sleep 10 + $BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title $TAG --draft ${releasetype} + else + cat $TMP_DIR/tea.log + return 1 + fi + fi release_draft false }