Skip to content

Commit f25eda3

Browse files
committed
fix looking for previous version
1 parent c116a18 commit f25eda3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

changelog-analysis/get_change_log.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,20 @@ def map_files_to_components(files: List[str], rules) -> Tuple[Set[str], List[str
134134
return impacted, unmatched
135135

136136

137+
def _release_branch(tag: str) -> str:
138+
# firefox-v150.2 -> release/v150.2
139+
version = tag.rsplit("-v", 1)[-1]
140+
return f"release/v{version}"
141+
142+
137143
def get_changed_files(owner: str, repo: str, base: str, head: str) -> List[str]:
144+
base_ref = _release_branch(base)
145+
head_ref = _release_branch(head)
138146
commit_shas = []
139147
page = 1
140148
while True:
141149
response = requests.get(
142-
f"https://api.github.com/repos/{owner}/{repo}/compare/{base}...{head}",
150+
f"https://api.github.com/repos/{owner}/{repo}/compare/{base_ref}...{head_ref}",
143151
headers=_github_headers(),
144152
params={"per_page": 100, "page": page},
145153
)

0 commit comments

Comments
 (0)