Metrics #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Metrics | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| permissions: | |
| contents: write | |
| jobs: | |
| github-metrics: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| - name: Generate repository metrics | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: | | |
| python .github/scripts/generate_repository_metrics.py \ | |
| --repo Mai-with-u/MaiBot \ | |
| --output depends-data/repository-metrics.svg | |
| - name: Commit repository metrics | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add depends-data/repository-metrics.svg | |
| if git diff --cached --quiet; then | |
| echo "No metrics changes." | |
| else | |
| git commit -m "docs: 更新仓库状态图" | |
| git push origin HEAD:${{ github.ref_name }} | |
| fi |