@@ -18,31 +18,30 @@ jobs:
1818 with :
1919 token : ${{ secrets.GITHUB_TOKEN }}
2020
21- - name : Update Contributors in HALL_OF_FAME.md and README.md
21+ - name : Fetch contributors and update Hall of Fame & README
2222 run : |
23+ # Fetch all contributors (excluding bots)
2324 CONTRIBUTORS=$(curl -s "https://api.github.com/repos/admirerr/DSA-Collection/contributors?per_page=100" \
2425 | jq -r '.[] | select(.type != "Bot") | [.login, .avatar_url, .html_url, .contributions] | @tsv' \
2526 | sort -k4,4nr)
2627
27- # Build Hall of Fame table with round avatars and handle below, wrapped in centered div
28- TABLE=$(echo "$CONTRIBUTORS" | awk -F'\t' '{printf "<div align =\"center\">| <div ><img src=\"%s\" width=\"50 \" height=\"50 \" style=\"border-radius:50%%;\"/ ><br>[%s](%s)</div> | %s |\n</div> ", $2 , $1 , $3, $4 }')
28+ # --- Build HTML blocks for Hall of Fame ---
29+ TABLE=$(echo "$CONTRIBUTORS" | awk -F'\t' '{printf "<a href =\"%s\" style=\"text-decoration:none; margin:10px;\" ><img src=\"%s\" width=\"80 \" height=\"80 \" style=\"border-radius:50%%;\"><br>%s</a>\n ", $3 , $2 , $1 }')
2930
30- # Build avatars row for README (round avatars, centered)
31- AVATARS="<div align=\"center\">$(echo "$CONTRIBUTORS" | awk -F'\t' '{printf "[<img src=\"%s\" width=\"50 \" height=\"50 \" style=\"border-radius:50%%;\" alt=\"%s\"/>](%s) ", $2, $1, $3}'))</div>"
31+ # --- Build avatars row for README ---
32+ AVATARS="<div align=\"center\">$(echo "$CONTRIBUTORS" | awk -F'\t' '{printf "[<img src=\"%s\" width=\"80 \" height=\"80 \" style=\"border-radius:50%%;\" alt=\"%s\"/>](%s) ", $2, $1, $3}'))</div>"
3233
33- # ---- Update Hall of Fame - ---
34+ # --- Update Hall of Fame ---
3435 awk -v table="$TABLE" '
35- /Contributor \| Contributions / {
36+ /<!-- Contributors will be automatically updated by GitHub Actions --> / {
3637 print;
37- print "|-------------|---------------|";
3838 print table;
39- in_block=1; next;
39+ next;
4040 }
41- in_block && /^\|/ {next}
4241 {print}
4342 ' HALL_OF_FAME.md > temp && mv temp HALL_OF_FAME.md
4443
45- # ---- Update README - ---
44+ # --- Update README ---
4645 awk -v avatars="$AVATARS" '
4746 /<!-- CONTRIBUTORS START -->/ {
4847 print;
@@ -56,12 +55,15 @@ jobs:
5655
5756 - name : Update Implementation Counts
5857 run : |
58+ # Update total implementations
5959 sed -i 's/| 🎯 \*\*Total Implementations\*\* | [0-9]\+ |/| 🎯 **Total Implementations** | 22 |/' HALL_OF_FAME.md
60+
61+ # Update per-language implementations
6062 sed -i '/### Python/{n;s/- Implementations: [0-9]\+/- Implementations: 6/}' HALL_OF_FAME.md
6163 sed -i '/### C++/{n;s/- Implementations: [0-9]\+/- Implementations: 4/}' HALL_OF_FAME.md
6264 sed -i '/### Java/{n;s/- Implementations: [0-9]\+/- Implementations: 12/}' HALL_OF_FAME.md
6365
64- - name : Commit changes
66+ - name : Commit and Push Changes
6567 run : |
6668 git config --local user.email "actions@github.com"
6769 git config --local user.name "GitHub Actions"
0 commit comments