Create wfgy-ecosystem-stars-bot.yml

This commit is contained in:
PSBigBig + MiniPS 2026-03-08 16:29:02 +08:00 committed by GitHub
parent dae0407ffa
commit d9c5aeba63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,46 @@
name: WFGY Ecosystem Stars Bot
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *"
jobs:
metrics:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Fetch repo metrics
run: |
curl -s https://api.github.com/repos/onestardao/WFGY > repo.json
STARS=$(cat repo.json | jq .stargazers_count)
FORKS=$(cat repo.json | jq .forks_count)
ISSUES=$(cat repo.json | jq .open_issues_count)
WATCHERS=$(cat repo.json | jq .subscribers_count)
{
echo "# WFGY Ecosystem Metrics"
echo
echo "Generated at: $(date -u)"
echo
echo "## Repo statistics"
echo
echo "Stars: $STARS"
echo "Forks: $FORKS"
echo "Open issues: $ISSUES"
echo "Watchers: $WATCHERS"
} > ecosystem-metrics.md
- name: Commit metrics
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add ecosystem-metrics.md
git diff --staged --quiet || git commit -m "bot: update ecosystem metrics"
git push