name: yarn-install runs: using: composite steps: - name: Install dependencies shell: bash run: | MAX_ATTEMPTS=2 ATTEMPT=0 WAIT_TIME=20 while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do yarn install --non-interactive --frozen-lockfile && break echo "yarn install failed. Retrying in $WAIT_TIME seconds..." sleep $WAIT_TIME ATTEMPT=$((ATTEMPT + 1)) done if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then echo "All attempts to invoke yarn install failed - Aborting the workflow" exit 1 fi