Skip to content

Commit 58789f6

Browse files
author
Taniya Mathur
committed
fix: use non-greedy S3-specific regex for URL extraction
1 parent 7634192 commit 58789f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/codebuild_deployment.py

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

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"
84+
# Extract template URL from output - match S3 URLs only
85+
template_url_pattern = r"https://s3\..*?idp-main\.yaml"
8686

87-
# Clean output and search for URL
88-
clean_stdout = re.sub(r'\s+', ' ', result.stdout.replace('\n', ' ').replace('\r', ' '))
87+
# Remove line breaks that might split the URL in terminal output
88+
clean_stdout = result.stdout.replace('\n', '').replace('\r', '')
8989
template_url_match = re.search(template_url_pattern, clean_stdout)
9090

9191
if template_url_match:

0 commit comments

Comments
 (0)