@@ -727,6 +727,24 @@ jobs:
727727 # that C1 WF token exchange and registry auth work end-to-end.
728728 # ================================================================
729729
730+ - name : Checkout connector repo (for docs)
731+ if : vars.C1_WF_CLIENT_ID != ''
732+ uses : actions/checkout@v5
733+ with :
734+ path : _connector
735+
736+ - name : Read connector documentation
737+ if : vars.C1_WF_CLIENT_ID != ''
738+ id : c1-docs
739+ run : |
740+ if [ -f "_connector/docs/connector.mdx" ]; then
741+ echo "Found docs/connector.mdx"
742+ echo "has_docs=true" >> "$GITHUB_OUTPUT"
743+ else
744+ echo "No docs/connector.mdx found"
745+ echo "has_docs=false" >> "$GITHUB_OUTPUT"
746+ fi
747+
730748 - name : Get GitHub OIDC token for C1 token exchange
731749 if : vars.C1_WF_CLIENT_ID != ''
732750 id : c1-oidc
@@ -765,17 +783,71 @@ jobs:
765783 continue-on-error : true
766784 env :
767785 REGISTRY_URL : " https://registry.conductorone.com"
786+ MANIFEST_FILE : _workflows/_output/manifest.json
768787 run : |
769788 set -euo pipefail
770789
790+ # Read documentation content if available
791+ DOCS=""
792+ if [ "${{ steps.c1-docs.outputs.has_docs }}" = "true" ]; then
793+ DOCS=$(cat _connector/docs/connector.mdx)
794+ fi
795+
796+ # Transform merged manifest assets: href->downloadUrl, signatureHref->signatureUrl, etc.
797+ ASSETS=$(jq '(.assets // {}) | to_entries | map({
798+ key: .key,
799+ value: {
800+ platform: .key,
801+ filename: .value.filename,
802+ mediaType: .value.mediaType,
803+ sizeBytes: .value.sizeBytes,
804+ sha256: .value.sha256,
805+ downloadUrl: .value.href,
806+ signatureUrl: .value.signatureHref,
807+ certificateUrl: .value.certificateHref,
808+ sbomUrl: .value.sbomHref
809+ }
810+ }) | from_entries' "$MANIFEST_FILE")
811+
812+ # Transform merged manifest images: map key becomes platform
813+ IMAGES=$(jq '(.images // {}) | to_entries | map({
814+ key: .key,
815+ value: {
816+ ref: .value.ref,
817+ digest: .value.digest,
818+ platform: .key
819+ }
820+ }) | from_entries' "$MANIFEST_FILE")
821+
822+ # Manifest-level signature URLs (from cosign sign-blob of manifest.json)
823+ SIG_URL=$(jq -r '.signatureHref // ""' "$MANIFEST_FILE")
824+ CERT_URL=$(jq -r '.certificateHref // ""' "$MANIFEST_FILE")
825+
771826 BODY=$(jq -n \
772827 --arg org "${{ github.event.repository.owner.login }}" \
773828 --arg name "${{ github.event.repository.name }}" \
774829 --arg version "${{ inputs.tag }}" \
775830 --arg repositoryUrl "https://github.com/${{ github.repository }}" \
776831 --arg commitSha "${{ github.sha }}" \
777832 --arg workflowRunId "${{ github.run_id }}" \
778- '{org: $org, name: $name, version: $version, repositoryUrl: $repositoryUrl, commitSha: $commitSha, workflowRunId: $workflowRunId}')
833+ --arg documentation "$DOCS" \
834+ --arg signatureUrl "$SIG_URL" \
835+ --arg certificateUrl "$CERT_URL" \
836+ --argjson assets "$ASSETS" \
837+ --argjson images "$IMAGES" \
838+ '{
839+ org: $org,
840+ name: $name,
841+ version: $version,
842+ repositoryUrl: $repositoryUrl,
843+ commitSha: $commitSha,
844+ workflowRunId: $workflowRunId,
845+ documentation: $documentation,
846+ signatureUrl: $signatureUrl,
847+ certificateUrl: $certificateUrl,
848+ assets: $assets,
849+ images: $images
850+ }')
779851
780852 HTTP_CODE=$(curl -s -o /tmp/c1wf-response.json -w "%{http_code}" \
781853 -X POST "${REGISTRY_URL}/api/v1/ingest/release" \
0 commit comments