From c444b51cb13165ed3c43b35eedccedf14c5280d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Birm=C3=A9?= Date: Mon, 2 Nov 2026 10:26:24 +0100 Subject: [PATCH] Revert "ci: sync-fork-dev uses the narrowed sync-fork key and scoped order lookup (#31)" Co-Authored-By: Claude --- .github/workflows/sync-fork-dev.yml | 32 ++++++++++------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/workflows/sync-fork-dev.yml b/.github/workflows/sync-fork-dev.yml index dc71b8f..207c4b9 100644 --- a/.github/workflows/sync-fork-dev.yml +++ b/.github/workflows/sync-fork-dev.yml @@ -19,30 +19,25 @@ jobs: timeout-minutes: 60 env: MAKER_URL: https://maker.svc.dev.osaas.io - SYNC_FORK_API_KEY: ${{ secrets.OSC_DEV_SYNC_FORK_API_KEY }} + MAKER_API_KEY: ${{ secrets.OSC_DEV_MAKER_API_KEY }} REPO_URL: https://github.com/${{ github.repository }} steps: - name: Trigger sync-fork id: sync run: | set -euo pipefail - if [ -z "$SYNC_FORK_API_KEY" ]; then - echo "::error::Secret OSC_DEV_SYNC_FORK_API_KEY is not set" + if [ -z "$MAKER_API_KEY" ]; then + echo "::error::Secret OSC_DEV_MAKER_API_KEY is not set" exit 1 fi - ORDERS=$(curl -sSf -G "$MAKER_URL/sync-fork/orders" \ + PREV_ORDER_ID=$(curl -sf -G "$MAKER_URL/maker" \ --data-urlencode "repositoryUrl=$REPO_URL" \ - -H "Authorization: Bearer $SYNC_FORK_API_KEY") - COUNT=$(echo "$ORDERS" | jq 'length') - if [ "$COUNT" -gt 1 ]; then - echo "::error::Expected at most one order for $REPO_URL, found $COUNT" - exit 1 - fi - PREV_ORDER_ID=$(echo "$ORDERS" | jq -r '.[0].order.orderId // "none"') + -H "Authorization: Bearer $MAKER_API_KEY" \ + | jq -r '.[0].order.orderId // "none"') echo "Order before sync: $PREV_ORDER_ID" echo "prev_order_id=$PREV_ORDER_ID" >> "$GITHUB_OUTPUT" - JOB_ID=$(curl -sSf -X POST "$MAKER_URL/sync-fork" \ - -H "Authorization: Bearer $SYNC_FORK_API_KEY" \ + JOB_ID=$(curl -sf -X POST "$MAKER_URL/sync-fork" \ + -H "Authorization: Bearer $MAKER_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"repositoryUrl\":\"$REPO_URL\"}" | jq -r '.jobId // empty') if [ -z "$JOB_ID" ]; then @@ -59,7 +54,7 @@ jobs: set -euo pipefail for i in $(seq 1 60); do RESP=$(curl -sf "$MAKER_URL/sync-fork/$JOB_ID" \ - -H "Authorization: Bearer $SYNC_FORK_API_KEY" || echo '{}') + -H "Authorization: Bearer $MAKER_API_KEY" || echo '{}') STATUS=$(echo "$RESP" | jq -r '.status // "unknown"') echo "sync-fork $JOB_ID status: $STATUS" case "$STATUS" in @@ -80,14 +75,9 @@ jobs: run: | set -euo pipefail for i in $(seq 1 120); do - ORDER=$(curl -sSf -G "$MAKER_URL/sync-fork/orders" \ + ORDER=$(curl -sf -G "$MAKER_URL/maker" \ --data-urlencode "repositoryUrl=$REPO_URL" \ - -H "Authorization: Bearer $SYNC_FORK_API_KEY" || echo '[]') - COUNT=$(echo "$ORDER" | jq 'length') - if [ "$COUNT" -gt 1 ]; then - echo "::error::Expected at most one order for $REPO_URL, found $COUNT" - exit 1 - fi + -H "Authorization: Bearer $MAKER_API_KEY" || echo '[]') ORDER_ID=$(echo "$ORDER" | jq -r '.[0].order.orderId // "none"') PHASE=$(echo "$ORDER" | jq -r '.[0].order.status.phase // "NOT_FOUND"') echo "order $ORDER_ID phase: $PHASE"