Skip to content

Commit ba4160e

Browse files
author
Taniya Mathur
committed
fix: handle line breaks and variable path segments in template URL extraction
1 parent d6dd1b2 commit ba4160e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/codebuild_deployment.py

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

84-
# Extract template URL from output
84+
# Extract template URL from output (handle line breaks that may split the URL)
8585
template_url_pattern = (
86-
r"https://s3\.[^/]+\.amazonaws\.com/[^/]+/[^/]+/idp-main\.yaml"
86+
r"https://s3\.[^/\s]+\.amazonaws\.com/[^/\s]+/.*?/idp-main\.yaml"
8787
)
88-
template_url_match = re.search(template_url_pattern, result.stdout)
88+
# Remove line breaks and extra whitespace that might split the URL
89+
clean_stdout = re.sub(r'\s+', ' ', result.stdout.replace('\n', ' ').replace('\r', ' '))
90+
template_url_match = re.search(template_url_pattern, clean_stdout)
8991

9092
if template_url_match:
9193
template_url = template_url_match.group(0)

0 commit comments

Comments
 (0)