@@ -20,20 +20,17 @@ jobs:
2020
2121 - name : Update Contributors in HALL_OF_FAME.md and README.md
2222 run : |
23- # Fetch contributors from GitHub
24- NEW_CONTRIBUTORS =$(curl -s "https://api.github.com/repos/admirerr/DSA-Collection/contributors?per_page=100" \
23+ # Fetch contributors from GitHub API (first 100)
24+ CONTRIBUTORS =$(curl -s "https://api.github.com/repos/admirerr/DSA-Collection/contributors?per_page=100" \
2525 | jq -r '.[] | select(.type != "Bot") | [.login, .avatar_url, .html_url, .contributions] | @tsv')
2626
27- # Extract existing contributors from HALL_OF_FAME.md
28- EXISTING_CONTRIBUTORS=$(awk -F'\t' '/<div align=/{print $0}' HALL_OF_FAME.md || true)
29-
30- # Merge, remove duplicates, and sort by contributions descending
31- ALL_CONTRIBUTORS=$(echo -e "$NEW_CONTRIBUTORS\n$EXISTING_CONTRIBUTORS" | awk '!seen[$0]++' | sort -k4,4nr)
27+ # Deduplicate contributors by login and sort by contributions descending
28+ ALL_CONTRIBUTORS=$(echo "$CONTRIBUTORS" | awk -F'\t' '!seen[$1]++' | sort -k4,4nr)
3229
3330 # Build Hall of Fame table (full)
3431 TABLE=$(echo "$ALL_CONTRIBUTORS" | awk -F'\t' '{printf "| <div align=\"center\"><img src=\"%s\" width=\"50\" height=\"50\"/><br>[%s](%s)</div> | %s |\n", $2, $1, $3, $4}')
3532
36- # Build avatars row for README (limit to 20)
33+ # Build avatars row for README (limit to top 20)
3734 AVATARS=$(echo "$ALL_CONTRIBUTORS" | head -n 20 | awk -F'\t' '{printf "[<img src=\"%s\" width=\"50\" height=\"50\" alt=\"%s\"/>](%s) ", $2, $1, $3}')
3835
3936 # ---- Update Hall of Fame ----
0 commit comments