From bf16682f429a5c4fa019337b9e02bfc6f660ea97 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Mon, 12 Feb 2024 13:16:00 -0500 Subject: [PATCH] Fix while loop (#7918) --- .github/workflows/version-bump.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index b955e729d55..73296674522 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -323,12 +323,15 @@ jobs: NEW_VERSION: ${{ inputs.version_number }} run: | # Wait for version to change. - do + while : ; do echo "Waiting for version to be updated..." git pull --force CURRENT_VERSION=$(cat package.json | jq -r '.version') + + # If the versions don't match we continue the loop, otherwise we break out of the loop. + [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]] || break sleep 10 - done while [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]] + done working-directory: apps/browser ### CLI @@ -338,12 +341,15 @@ jobs: NEW_VERSION: ${{ inputs.version_number }} run: | # Wait for version to change. - do + while : ; do echo "Waiting for version to be updated..." git pull --force CURRENT_VERSION=$(cat package.json | jq -r '.version') + + # If the versions don't match we continue the loop, otherwise we break out of the loop. + [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]] || break sleep 10 - done while [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]] + done working-directory: apps/cli ### Desktop @@ -353,12 +359,15 @@ jobs: NEW_VERSION: ${{ inputs.version_number }} run: | # Wait for version to change. - do + while : ; do echo "Waiting for version to be updated..." git pull --force CURRENT_VERSION=$(cat package.json | jq -r '.version') + + # If the versions don't match we continue the loop, otherwise we break out of the loop. + [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]] || break sleep 10 - done while [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]] + done working-directory: apps/desktop ### Web @@ -368,12 +377,15 @@ jobs: NEW_VERSION: ${{ inputs.version_number }} run: | # Wait for version to change. - do + while : ; do echo "Waiting for version to be updated..." git pull --force CURRENT_VERSION=$(cat package.json | jq -r '.version') + + # If the versions don't match we continue the loop, otherwise we break out of the loop. + [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]] || break sleep 10 - done while [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]] + done working-directory: apps/web - name: Cut RC branch