Update GitHub Stats #68
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: Update GitHub Stats | |
| on: | |
| schedule: | |
| - cron: '0 3 * * *' # 3 AM UTC daily | |
| workflow_dispatch: # allow manual run any time | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-stats: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Fetch contribution stats | |
| env: | |
| GH_TOKEN: ${{ secrets.STATS_TOKEN }} | |
| run: python3 .github/scripts/fetch_stats.py | |
| - name: Commit and push | |
| env: | |
| STATS_TOKEN: ${{ secrets.STATS_TOKEN }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add "Source Code/github-stats.json" | |
| git diff --staged --quiet && echo "No changes." && exit 0 | |
| git commit -m "chore: update github stats $(date -u +%Y-%m-%d)" | |
| git remote set-url origin https://x-access-token:${STATS_TOKEN}@github.com/Archit-Konde/Archit-Konde.github.io.git | |
| git push |