@@ -206,7 +206,7 @@ ensure_repository() {
206206
207207 REPOSITORY_ID=$( echo " ${repos} " | jq -r \
208208 --arg url " ${REPO_URL} " \
209- ' [.[] | select(.url == $url)] | first // empty | .id' )
209+ ' [.data [] | select(.url == $url)] | first // empty | .id' )
210210
211211 if [[ -n " ${REPOSITORY_ID} " && " ${REPOSITORY_ID} " != " null" ]]; then
212212 log_info " Found existing repository: ${REPOSITORY_ID} "
@@ -267,7 +267,7 @@ ensure_repository() {
267267 result=$( arcane_api POST " /customize/git-repositories" -d " ${create_payload} " )
268268
269269 # [H7] Validate the response contains a real ID
270- REPOSITORY_ID=$( jq_extract_id " ${result} " ' .id' " create repository" )
270+ REPOSITORY_ID=$( jq_extract_id " ${result} " ' .data. id' " create repository" )
271271 log_info " Created repository: ${REPOSITORY_ID} "
272272 fi
273273
@@ -286,7 +286,7 @@ upsert_sync() {
286286 existing_id=$( echo " ${existing_syncs} " | jq -r \
287287 --arg composePath " ${compose_path} " \
288288 --arg repoId " ${REPOSITORY_ID} " \
289- ' [.[] | select(.composePath == $composePath and .repositoryId == $repoId)] | first // empty | .id' )
289+ ' [.data [] | select(.composePath == $composePath and .repositoryId == $repoId)] | first // empty | .id' )
290290
291291 local sync_id
292292 if [[ -n " ${existing_id} " && " ${existing_id} " != " null" ]]; then
@@ -338,7 +338,7 @@ upsert_sync() {
338338 result=$( arcane_api POST " /environments/${ENV_ID} /gitops-syncs" -d " ${create_payload} " )
339339
340340 # [H7] Validate the response contains a real ID
341- sync_id=$( jq_extract_id " ${result} " ' .id' " create sync '${sync_name} '" )
341+ sync_id=$( jq_extract_id " ${result} " ' .data. id' " create sync '${sync_name} '" )
342342 log_info " Created sync: ${sync_id} "
343343
344344 SYNCS_CREATED=$(( SYNCS_CREATED + 1 ))
0 commit comments