Skip to content

Commit cfcf626

Browse files
Fix find label code (Azure#39245)
* fix find label code * remove debug
1 parent df7dc2f commit cfcf626

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

scripts/repo_health_status_report/output_health_report.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,11 @@ def map_codeowners_to_label(
651651
if len(parts) > 3:
652652
# we don't distinguish past package level for SLA
653653
continue
654-
service_directory = parts[0]
654+
try:
655+
service_directory = parts[0]
656+
except IndexError:
657+
# it was a single file
658+
continue
655659
tracked_labels[label] = service_directory
656660
try:
657661
library = parts[1]

tools/azure-sdk-tools/gh_tools/vnext_issue_creator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ def get_labels(package_name: str, service: str) -> list[str]:
107107
parts = [part for part in line.split("@")[0].split("/") if part.strip()][1:]
108108
if len(parts) > 2:
109109
continue
110-
service_directory = parts[0]
110+
try:
111+
service_directory = parts[0]
112+
except IndexError:
113+
# it was a single file
114+
continue
111115
try:
112116
library = parts[1]
113117
if package_name == library:

0 commit comments

Comments
 (0)