From f72a9638eb918e5d190e72d7055bf9b1dcc4f0f2 Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 5 Sep 2024 18:48:36 -0700 Subject: [PATCH] Poll release until it exists or 10 seconds go by --- .github/workflows/deploy.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e18cbe15fc6b..6c03ab14d830 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -479,7 +479,14 @@ jobs: uses: actions/download-artifact@v4 - name: 🚀 Create prerelease 🚀 - run: gh release create ${{ env.STAGING_VERSION }} --title ${{ env.STAGING_VERSION }} --generate-notes --prerelease --target staging + run: | + gh release create ${{ env.STAGING_VERSION }} --title ${{ env.STAGING_VERSION }} --generate-notes --prerelease --target staging + RETRIES=0 + MAX_RETRIES=10 + until [[ $(gh release view ${{ env.STAGING_VERSION }}) || $RETRIES -ge $MAX_RETRIES ]]; do + echo "release not found, retrying $((MAX_RETRIES - RETRIES++)) times" + sleep 1 + done env: GITHUB_TOKEN: ${{ github.token }}