Scheduled Repo Search #11
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
| # File: .github/workflows/search.yml | |
| name: Cloudflare Worker Repository Search | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 0' # Weekly, or change to '0 0 * * *' for daily | |
| workflow_dispatch: | |
| jobs: | |
| execute-search: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| cache-dependency-path: 'scripts/github/workflows/requirements.txt' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r scripts/github/workflows/requirements.txt | |
| - name: Run Search Script | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| WORKER_API_URL: ${{ secrets.WORKER_API_URL }} # Add this to your Repo Secrets | |
| run: python scripts/github/workflows/search_repos.py | |
| - name: Upload Search Results Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: search-results-json | |
| path: results.json # The script now saves here | |
| if-no-files-found: error |