()
| 47 | |
| 48 | |
| 49 | def main(): |
| 50 | # Fetch all branches |
| 51 | branches = fetch_all_branches(USER, REPO) |
| 52 | |
| 53 | # Filter branches. |
| 54 | # print(f"Total branches: {len(branches)}") |
| 55 | filtered_branches = [] |
| 56 | for branch in branches: |
| 57 | if branch.startswith("v") and ("-release" in branch or "-patch" in branch): |
| 58 | filtered_branches.append(branch) |
| 59 | # print(f"Filtered: {branch}") |
| 60 | |
| 61 | sorted_branches = sorted(filtered_branches, key=lambda x: parse(x.split("-")[0][1:]), reverse=True) |
| 62 | latest_branch = sorted_branches[0] |
| 63 | # print(f"Latest branch: {latest_branch}") |
| 64 | return latest_branch |
| 65 | |
| 66 | |
| 67 | if __name__ == "__main__": |
no test coverage detected