From c1db6ff9fee773b35a646746ef8c8834b7beb784 Mon Sep 17 00:00:00 2001 From: andreaangiolillo Date: Tue, 20 Aug 2024 12:07:10 +0100 Subject: [PATCH] feat: add `x-xgen-sha` to the generated foascli --- .github/scripts/download_specs.sh | 4 ++++ .github/scripts/generate_federated_spec.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/scripts/download_specs.sh b/.github/scripts/download_specs.sh index fb58e09eb..96295efb7 100755 --- a/.github/scripts/download_specs.sh +++ b/.github/scripts/download_specs.sh @@ -10,5 +10,9 @@ jq -c '.services[]' foas-metadata.json | while read -r service; do echo "Downloading the OpenAPI Spec for ${name} with sha ${sha}" aws s3 cp "s3://${S3_BUCKET}/openapi/oas/${name}/${sha}.json" "openapi-${name}.json" + + if [[ "${name}" == "mms" ]]; then + echo "FOAS_SHA=${sha}" >> "${GITHUB_ENV:?}" + fi done diff --git a/.github/scripts/generate_federated_spec.sh b/.github/scripts/generate_federated_spec.sh index 6a4902340..144136a24 100755 --- a/.github/scripts/generate_federated_spec.sh +++ b/.github/scripts/generate_federated_spec.sh @@ -8,6 +8,6 @@ service_array+=("-e" "openapi-${service}.json") done < <(jq -r '.services[] | select(.name != "mms") | .name' foas-metadata.json) echo "Running FOAS CLI merge command with the following services: " "${service_array[@]}" -foascli merge -b openapi-mms.json "${service_array[@]}" -o openapi-foas.json -x -f json -foascli merge -b openapi-mms.json "${service_array[@]}" -o openapi-foas.yaml -x -f yaml +foascli merge -b openapi-mms.json "${service_array[@]}" -o openapi-foas.json -x -f json --sha "${FOAS_SHA}" +foascli merge -b openapi-mms.json "${service_array[@]}" -o openapi-foas.yaml -x -f yaml --sha "${FOAS_SHA}"