Skip to content

An open-source, faster Devin alternative

TypeScript

fix: validate zero-percent ferry deployment (#1011)

Mohamed Habib231fbf18da40
diff --git a/.github/workflows/ferry-worker-secrets-to-infisical.yml b/.github/workflows/ferry-worker-secrets-to-infisical.yml
index 5278c562..73dc5119 100644
--- a/.github/workflows/ferry-worker-secrets-to-infisical.yml
+++ b/.github/workflows/ferry-worker-secrets-to-infisical.yml
@@ -51,11 +51,12 @@ jobs:
deployment="$(curl --proto '=https' --tlsv1.2 --fail --silent --show-error --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/workers/scripts/$API_EDGE_WORKER/deployments")"
jq --exit-status --arg live "$API_EDGE_LIVE_VERSION" --arg ferry "$API_EDGE_FERRY_VERSION" '
- .success == true and
- (.result.deployments | max_by(.created_on).versions) as $versions and
- ($versions | length) == 2 and
- any($versions[]; .version_id == $live and .percentage == 100) and
- any($versions[]; .version_id == $ferry and .percentage == 0)
+ .success == true and (
+ (.result.deployments | max_by(.created_on) | .versions) as $versions |
+ ($versions | length) == 2 and
+ any($versions[]; .version_id == $live and .percentage == 100) and
+ any($versions[]; .version_id == $ferry and .percentage == 0)
+ )
' <<<"$deployment" >/dev/null
versions="$(curl --proto '=https' --tlsv1.2 --fail --silent --show-error --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/workers/scripts/opencomputer-log-tail-prod/versions")"