mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-04-11 23:48:27 +00:00
Added auto editing of Top Contributors
This commit is contained in:
45
.github/workflows/update-contributors.yml
vendored
Normal file
45
.github/workflows/update-contributors.yml
vendored
Normal 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"
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user