Minor tweaks to cloud update script and GH workflow script (#14477)

* Minor tweaks to cloud update script and GH workflow script

* Fixes
This commit is contained in:
Neil MacDougall 2025-06-13 13:20:52 +01:00 committed by GitHub
parent 449803238f
commit c4606138de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -26,7 +26,7 @@ BODY_FILE=$(mktemp)
# This script returns a non-zero error code if there are changes # This script returns a non-zero error code if there are changes
set +e set +e
${BASE_DIR}/scripts/aws/update-data > ${BODY_FILE} ${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} ${BASE_DIR}/scripts/azure/update-data >> ${BODY_FILE}
cat ${BODY_FILE} cat ${BODY_FILE}

View File

@ -149,13 +149,15 @@ axios.get(ENDPOINTS_URL, { responseType: 'document' }).then((res) => {
} }
const regions = findRegions(res.data); const regions = findRegions(res.data);
const govRegions = existing.filter((r) => r.startsWith(US_GOV));
const existingCount = existing.length;
if (regions.length === 0) { if (regions.length === 0) {
console.error('Could not fetch data from Azure - no regions found'); console.error('Could not fetch data from Azure - no regions found');
process.exit(2); 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(existing);
console.log(''); 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) { if (removed.length) {
console.log(`These region(s) have been removed: ${ removed.join(', ') }`); 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) { if (added.length || removed.length) {
// Sort the regions (needs a resort if we added back in usgov regions) // Sort the regions (needs a resort if we added back in usgov regions)
writeNewFile(regions.sort()); writeNewFile(regions.sort());
console.log('');
console.log(`Regions updated from ${ existingCount } to ${ regions.length }`);
console.log('');
} else { } else {
console.log('No changes to the Azure region data'); console.log('No changes to the Azure region data');
} }