diff --git a/.github/workflows/streak-stats.yml b/.github/workflows/streak-stats.yml new file mode 100644 index 0000000..6854c7f --- /dev/null +++ b/.github/workflows/streak-stats.yml @@ -0,0 +1,33 @@ +name: Update streak stats + +on: + schedule: + - cron: "0 3 * * *" # Run every day at 03:00 + push: + paths: + - ".github/workflows/streak-stats.yml" # Run any time this file is modified + workflow_dispatch: # Run manually from the Actions tab + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - name: Generate streak stats + uses: DenverCoder1/github-readme-streak-stats@main + with: + options: user=${{ github.repository_owner }}&theme=github-dark&disable_animations=true + path: profile/streak.svg + token: ${{ secrets.METRICS_TOKEN }} + + - name: Commit streak stats + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add profile/streak.svg + git commit -m "Update streak stats" || exit 0 + git push