Skip to content

Metrics

Metrics #6

Workflow file for this run

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