@@ -739,23 +739,47 @@ jobs:
739739 env :
740740 REGISTRY_API_URL : ${{ vars.REGISTRY_API_URL }}
741741 REGISTRY_TOKEN : ${{ steps.registry-oidc-token.outputs.token }}
742+ MANIFEST_URL : ${{ steps.upload-manifest.outputs.manifest_url }}
743+ IMAGES_MANIFEST : ${{ needs.goreleaser-docker.outputs.images_manifest }}
742744 run : |
743745 CONNECTOR_ORG="${GITHUB_REPOSITORY_OWNER}"
744746 CONNECTOR_NAME="${GITHUB_REPOSITORY##*/}"
745- VERSION="${GITHUB_REF_NAME#v}"
747+ VERSION="${{ inputs.tag }}"
748+
749+ # Build images object from goreleaser-docker output (if available)
750+ IMAGES_FIELD=""
751+ if [ -n "${IMAGES_MANIFEST}" ]; then
752+ IMAGES_FIELD=$(echo "${IMAGES_MANIFEST}" | jq -c '.' 2>/dev/null || echo "")
753+ fi
754+
755+ # Assemble payload using jq to avoid shell quoting issues
756+ PAYLOAD=$(jq -n \
757+ --arg org "${CONNECTOR_ORG}" \
758+ --arg name "${CONNECTOR_NAME}" \
759+ --arg version "${VERSION}" \
760+ --arg repositoryUrl "https://github.com/${GITHUB_REPOSITORY}" \
761+ --arg commitSha "${GITHUB_SHA}" \
762+ --arg workflowRunId "${GITHUB_RUN_ID}" \
763+ --arg signatureUrl "${MANIFEST_URL:+${MANIFEST_URL%.json}.json.sig}" \
764+ --arg certificateUrl "${MANIFEST_URL:+${MANIFEST_URL%.json}.json.cert}" \
765+ --argjson images "${IMAGES_FIELD:-null}" \
766+ '{
767+ org: $org,
768+ name: $name,
769+ version: $version,
770+ repositoryUrl: $repositoryUrl,
771+ commitSha: $commitSha,
772+ workflowRunId: $workflowRunId
773+ }
774+ + (if $images != null then {images: $images} else {} end)
775+ + (if $signatureUrl != "" then {signatureUrl: $signatureUrl} else {} end)
776+ + (if $certificateUrl != "" then {certificateUrl: $certificateUrl} else {} end)')
746777
747778 HTTP_STATUS=$(curl -s -o /tmp/registry-response.json -w "%{http_code}" \
748779 -X POST "${REGISTRY_API_URL}/api/v1/ingest/release" \
749780 -H "Authorization: Bearer ${REGISTRY_TOKEN}" \
750781 -H "Content-Type: application/json" \
751- -d "{
752- \"org\": \"${CONNECTOR_ORG}\",
753- \"name\": \"${CONNECTOR_NAME}\",
754- \"version\": \"${VERSION}\",
755- \"repositoryUrl\": \"https://github.com/${GITHUB_REPOSITORY}\",
756- \"commitSha\": \"${GITHUB_SHA}\",
757- \"workflowRunId\": \"${GITHUB_RUN_ID}\"
758- }")
782+ -d "${PAYLOAD}")
759783
760784 echo "Registry API response: ${HTTP_STATUS}"
761785 cat /tmp/registry-response.json
0 commit comments