From c4606138deb4b34321b13aa25601ff758503d10c Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Fri, 13 Jun 2025 13:20:52 +0100 Subject: [PATCH] Minor tweaks to cloud update script and GH workflow script (#14477) * Minor tweaks to cloud update script and GH workflow script * Fixes --- .github/workflows/scripts/update-cloud-data.sh | 2 +- scripts/azure/update-data | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/update-cloud-data.sh b/.github/workflows/scripts/update-cloud-data.sh index d658ef2c94..aa302e9f52 100755 --- a/.github/workflows/scripts/update-cloud-data.sh +++ b/.github/workflows/scripts/update-cloud-data.sh @@ -26,7 +26,7 @@ BODY_FILE=$(mktemp) # This script returns a non-zero error code if there are changes set +e ${BASE_DIR}/scripts/aws/update-data > ${BODY_FILE} -echo "\n" >> ${BODY_FILE} +echo "" >> ${BODY_FILE} # Add blank line ${BASE_DIR}/scripts/azure/update-data >> ${BODY_FILE} cat ${BODY_FILE} diff --git a/scripts/azure/update-data b/scripts/azure/update-data index f22c94070d..4cc043c129 100755 --- a/scripts/azure/update-data +++ b/scripts/azure/update-data @@ -149,13 +149,15 @@ axios.get(ENDPOINTS_URL, { responseType: 'document' }).then((res) => { } const regions = findRegions(res.data); + const govRegions = existing.filter((r) => r.startsWith(US_GOV)); + const existingCount = existing.length; if (regions.length === 0) { console.error('Could not fetch data from Azure - no regions found'); process.exit(2); } - console.log(`Existing regions in our codebase: ${ existing.length }`); + console.log(`Existing regions in our codebase: ${ existingCount - govRegions.length } (Excluding US Government regions)`); console.log(existing); console.log(''); @@ -173,6 +175,10 @@ axios.get(ENDPOINTS_URL, { responseType: 'document' }).then((res) => { } }); + console.log(''); + console.log(`US Government regions to be retained: ${ govRegions.join(', ') }`); + console.log(''); + if (removed.length) { console.log(`These region(s) have been removed: ${ removed.join(', ') }`); } @@ -192,6 +198,10 @@ axios.get(ENDPOINTS_URL, { responseType: 'document' }).then((res) => { if (added.length || removed.length) { // Sort the regions (needs a resort if we added back in usgov regions) writeNewFile(regions.sort()); + + console.log(''); + console.log(`Regions updated from ${ existingCount } to ${ regions.length }`); + console.log(''); } else { console.log('No changes to the Azure region data'); }