From 5cd8cae0c9db7ae4bfb98e42ec9c7ab2e6ebd17f Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Mon, 13 Feb 2023 17:04:49 +0800 Subject: [PATCH] [workflow] fixed communtity report ranking (#2680) --- .../scripts/generate_leaderboard_and_send_to_lark.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/scripts/generate_leaderboard_and_send_to_lark.py b/.github/workflows/scripts/generate_leaderboard_and_send_to_lark.py index 36cdd9518..16b8957c1 100644 --- a/.github/workflows/scripts/generate_leaderboard_and_send_to_lark.py +++ b/.github/workflows/scripts/generate_leaderboard_and_send_to_lark.py @@ -292,7 +292,13 @@ def generate_user_engagement_leaderboard_image(github_token: str, output_path: s y = [] if len(total_engagement_count) > 0: + ranking = [] for name, count in total_engagement_count.items(): + ranking.append((name, count)) + + ranking.sort(key=lambda x: x[1], reverse=True) + + for name, count in ranking: x.append(count) y.append(name)