fix(regex): full match

This commit is contained in:
闵政杰523370910252 2025-06-20 22:58:29 +08:00
parent 0f39e660d0
commit fabcce0893
GPG Key ID: 6C70BDBE2E8F4DE0

View File

@ -449,7 +449,7 @@ class Gitea:
logger.info("Dry run enabled. No changes will be made to the repositories.")
logger.info(f"Archiving repos with name matching {regex}")
for repo_name in self.get_all_repo_names():
if re.match(regex, repo_name):
if re.fullmatch(regex, repo_name):
logger.info(f"Archived {repo_name}")
if not dry_run:
self.repository_api.repo_edit(
@ -504,7 +504,7 @@ class Gitea:
self, milestone: str, regex: str, due_date: str, description: str
) -> None:
for repo_name in self.get_all_repo_names():
if not re.match(regex, repo_name):
if not re.fullmatch(regex, repo_name):
continue
milestone_list = self.issue_api.issue_get_milestones_list(
self.org_name, repo_name