Update LeetCode Stats #127
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 LeetCode Stats | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Runs every day at midnight UTC | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| update-readme: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: pip install requests beautifulsoup4 | |
| - name: Run update script | |
| run: python update_readme.py | |
| - name: Commit and push changes | |
| run: | | |
| git config --global user.name "github-actions" | |
| git config --global user.email "actions@github.com" | |
| git add README.md | |
| git commit -m "Updated LeetCode stats in README.md" || echo "No changes to commit" | |
| git push |