Skip to content

Commit 7c495d4

Browse files
author
Taniya Mathur
committed
fix: simplify URL extraction to handle line-wrapped output
1 parent ba4160e commit 7c495d4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/codebuild_deployment.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,10 @@ def publish_templates():
8181
cmd = f"./publish.sh {bucket_basename} {prefix} {region}"
8282
result = run_command(cmd)
8383

84-
# Extract template URL from output (handle line breaks that may split the URL)
85-
template_url_pattern = (
86-
r"https://s3\.[^/\s]+\.amazonaws\.com/[^/\s]+/.*?/idp-main\.yaml"
87-
)
88-
# Remove line breaks and extra whitespace that might split the URL
84+
# Extract template URL from output - find any S3 URL ending with idp-main.yaml
85+
template_url_pattern = r"https://s3[^/]*\.amazonaws\.com/[^\s]+/idp-main\.yaml"
86+
87+
# Clean output and search for URL
8988
clean_stdout = re.sub(r'\s+', ' ', result.stdout.replace('\n', ' ').replace('\r', ' '))
9089
template_url_match = re.search(template_url_pattern, clean_stdout)
9190

0 commit comments

Comments
 (0)