Added auto editing of Top Contributors

This commit is contained in:
Divarion-D
2025-12-03 21:42:41 +03:00
parent 4ce32fc8c3
commit ef9d09c2e6
2 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,45 @@
name: Update Contributors
on:
push:
branches: [ main ]
workflow_dispatch: {}
jobs:
update-contributors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get contributors (PR authors)
run: |
gh api repos/${{ github.repository }}/pulls \
--paginate --jq '.[] | select(.merged_at != null) | .user.login' > merged_authors.txt
sort merged_authors.txt | uniq -c | sort -nr > contributors_count.txt
- name: Build Markdown table
run: |
echo "| Contributor | PRs Merged | Highlights |" > stars_table.md
echo "| ----------- | ---------- | ---------- |" >> stars_table.md
while read count author; do
echo "| @$author | $count | Awesome contributions! |" >> stars_table.md
done < contributors_count.txt
- name: Update CONTRIBUTORS.md
run: |
awk '
BEGIN { in_block=0 }
/<!-- STARS_TABLE_START -->/ { print; print system("cat stars_table.md"); in_block=1; next }
/<!-- STARS_TABLE_END -->/ { in_block=0 }
in_block==0 { print }
' CONTRIBUTORS.md > CONTRIBUTORS.new.md
mv CONTRIBUTORS.new.md CONTRIBUTORS.md
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update community stars"

View File

@@ -15,9 +15,11 @@ Want to see your name here? [Open a PR](https://github.com/Vateron-Media/XC_VM/p
## 🌟 Community Stars *(Top Contributors)*
<!-- STARS_TABLE_START -->
| Contributor | PRs Merged | Highlights |
| ----------- | ---------- | -------------------- |
| *None yet* | — | Waiting for your PR! |
<!-- STARS_TABLE_END -->
---
@@ -25,7 +27,7 @@ Want to see your name here? [Open a PR](https://github.com/Vateron-Media/XC_VM/p
### 💻 Code
* *No code contributions yet*
* [@gpechieu](https://github.com/gpechieu) — Fixing bugs and adding features
### 📖 Documentation