fix(release): add retry and delay for PR creation to handle Gitea API race condition #18
@@ -189,7 +189,11 @@ jobs:
|
||||
fi
|
||||
|
||||
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 "Content-Type: application/json" \
|
||||
--data "$(jq -n \
|
||||
@@ -198,7 +202,14 @@ jobs:
|
||||
--arg head "next-release" \
|
||||
--arg base "${DEFAULT_BRANCH}" \
|
||||
'{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:
|
||||
name: Create Release
|
||||
|
||||
Reference in New Issue
Block a user