Merge pull request 'fix(release): add retry and delay for PR creation to handle Gitea API race condition' (#18) from fix-release-pr-race-condition into main

Reviewed-on: #18
This commit was merged in pull request #18.
This commit is contained in:
2026-02-23 13:13:23 +00:00
+13 -2
View File
@@ -189,7 +189,11 @@ jobs:
fi fi
echo "Creating new PR..." echo "Creating new PR..."
curl -sf --retry 3 --retry-delay 2 --retry-connrefused -X POST \ echo "Waiting for branch to be ready..."
sleep 3
RESPONSE=$(curl -s --retry 3 --retry-delay 3 --retry-all-errors --retry-connrefused \
-w "\n%{http_code}" -X POST \
-H "Authorization: token ${TOKEN}" \ -H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
--data "$(jq -n \ --data "$(jq -n \
@@ -198,7 +202,14 @@ jobs:
--arg head "next-release" \ --arg head "next-release" \
--arg base "${DEFAULT_BRANCH}" \ --arg base "${DEFAULT_BRANCH}" \
'{title: $title, body: $body, head: $head, base: $base}')" \ '{title: $title, body: $body, head: $head, base: $base}')" \
"${API_URL}/pulls" "${API_URL}/pulls")
HTTP_CODE=$(echo "${RESPONSE}" | tail -1)
BODY=$(echo "${RESPONSE}" | sed '$d')
if [ "${HTTP_CODE}" -ge 400 ]; then
echo "Error creating PR (HTTP ${HTTP_CODE}): ${BODY}"
exit 1
fi
echo "PR created successfully"
create-release: create-release:
name: Create Release name: Create Release