diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c53e6866..26520106 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,12 +154,14 @@ jobs: - name: Check for existing deployment id: check-deployment run: | - in_progress=$(curl -s \ + response=$(curl -s \ --connect-timeout 30 \ --max-time 60 \ -H "Authorization: Bearer ${{ secrets.DEPLOYMENT_TOKEN }}" \ - "http://147.93.126.54:8000/api/v1/deployments" \ - | jq --arg app_id "${{ secrets.APPLICATION_ID }}" '[.[] | select((.application_id | tostring) == $app_id and .commit == "HEAD")] | length') + "http://147.93.126.54:8000/api/v1/deployments") + + in_progress=$(echo "$response" | jq --arg app_id "${{ secrets.APPLICATION_ID }}" \ + 'map(select(.application_id == $app_id and .commit == "HEAD")) | length') echo "Deployments in progress: $in_progress"