ci: add AppVeyor API monitoring loop scripts #142
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: Fetch LeetCode Signatures | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| schedule: | |
| # Run every 6 hours to gradually process all problems without hitting hard rate limits | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: | |
| # Allow manual triggering | |
| permissions: | |
| contents: write | |
| jobs: | |
| fetch-signatures: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests | |
| - name: Run fetch script | |
| run: python fetch_signatures.py | |
| - name: Pull remote changes | |
| run: git pull origin ${{ github.head_ref || github.ref_name }} --rebase --autostash | |
| - name: Commit changes | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: "chore(data): auto-update problem signatures from LeetCode" | |
| file_pattern: "problems/**/*.json" | |
| commit_user_name: "github-actions[bot]" | |
| commit_user_email: "github-actions[bot]@users.noreply.github.com" | |
| commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" |