bin/ci: escape literal url in regex

Fixes: b24dd1fa1c ("ci: Fix parse GitLab pipeline url")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29718>
This commit is contained in:
Eric Engestrom
2024-06-13 16:29:05 +02:00
committed by Marge Bot
parent 5c50e028d1
commit 44e6850016

View File

@@ -50,7 +50,7 @@ def get_gitlab_pipeline_from_url(gl, pipeline_url) -> tuple:
:param pipeline_url: string with a url to a pipeline
:return: ProjectPipeline, Project objects
"""
pattern = rf"^{GITLAB_URL}/(.*)/-/pipelines/([0-9]+)$"
pattern = rf"^{re.escape(GITLAB_URL)}/(.*)/-/pipelines/([0-9]+)$"
match = re.match(pattern, pipeline_url)
if not match:
raise AssertionError(f"url {pipeline_url} doesn't follow the pattern {pattern}")