Skip to content

Commit dac631b

Browse files
committed
updated configs
1 parent 18b4751 commit dac631b

2 files changed

Lines changed: 28 additions & 24 deletions

File tree

.github/workflows/update-contributors.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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"

HALL_OF_FAME.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@ We are incredibly grateful to all our amazing contributors who make this reposit
44

55
<div align="center">
66

7-
| Contributor | Contributions |
8-
|-------------|---------------|
9-
<div align="center">| <div><img src="https://avatars.githubusercontent.com/u/79766263?v=4" width="50" height="50" style="border-radius:50%;"/><br>[admirerr](https://github.com/admirerr)</div> | 72 |
10-
</div><div align="center">| <div><img src="https://avatars.githubusercontent.com/u/171781925?v=4" width="50" height="50" style="border-radius:50%;"/><br>[Vivek13121](https://github.com/Vivek13121)</div> | 3 |
11-
</div><div align="center">| <div><img src="https://avatars.githubusercontent.com/u/65916846?v=4" width="50" height="50" style="border-radius:50%;"/><br>[actions-user](https://github.com/actions-user)</div> | 3 |
12-
</div><div align="center">| <div><img src="https://avatars.githubusercontent.com/u/222441895?v=4" width="50" height="50" style="border-radius:50%;"/><br>[adesh2756](https://github.com/adesh2756)</div> | 3 |
13-
</div><div align="center">| <div><img src="https://avatars.githubusercontent.com/u/72244992?v=4" width="50" height="50" style="border-radius:50%;"/><br>[Anujmishra2005](https://github.com/Anujmishra2005)</div> | 1 |
14-
</div><div align="center">| <div><img src="https://avatars.githubusercontent.com/u/41038007?v=4" width="50" height="50" style="border-radius:50%;"/><br>[djashan](https://github.com/djashan)</div> | 1 |
15-
</div><div align="center">| <div><img src="https://avatars.githubusercontent.com/u/197562965?v=4" width="50" height="50" style="border-radius:50%;"/><br>[ramanuj-droid](https://github.com/ramanuj-droid)</div> | 1 |
16-
</div><div align="center">| <div><img src="https://avatars.githubusercontent.com/u/109014091?v=4" width="50" height="50" style="border-radius:50%;"/><br>[ruturajjadhav07](https://github.com/ruturajjadhav07)</div> | 1 |
17-
</div><div align="center">| <div><img src="https://avatars.githubusercontent.com/u/103595490?v=4" width="50" height="50" style="border-radius:50%;"/><br>[sujanrupu](https://github.com/sujanrupu)</div> | 1 |
18-
</div>
197
<!-- Contributors will be automatically updated by GitHub Actions -->
8+
<!-- Example: -->
9+
<a href="https://github.com/admirerr" style="text-decoration:none; margin:10px;">
10+
<img src="https://avatars.githubusercontent.com/u/79766263?v=4" width="80" height="80" style="border-radius:50%;"><br>
11+
admirerr
12+
</a>
13+
<a href="https://github.com/Vivek13121" style="text-decoration:none; margin:10px;">
14+
<img src="https://avatars.githubusercontent.com/u/171781925?v=4" width="80" height="80" style="border-radius:50%;"><br>
15+
Vivek13121
16+
</a>
17+
<a href="https://github.com/actions-user" style="text-decoration:none; margin:10px;">
18+
<img src="https://avatars.githubusercontent.com/u/65916846?v=4" width="80" height="80" style="border-radius:50%;"><br>
19+
actions-user
20+
</a>
2021

2122
</div>
2223

2324
---
2425

26+
| 🎯 **Total Implementations** | 22 |
2527

2628
---
2729

0 commit comments

Comments
 (0)