1- # File: .github/workflows/search.yml
2- name : Cloudflare Worker Repository Search
1+ name : Scheduled Repo Search
32
43on :
54 schedule :
6- - cron : ' 0 0 * * 0' # Weekly, or change to '0 0 * * *' for daily
7- workflow_dispatch :
5+ # Runs at 00:00 UTC every day. You can adjust the cron schedule as needed.
6+ - cron : ' 0 0 * * *'
7+ workflow_dispatch : # Allows manual trigger from the Actions UI
8+
9+ # 🚨 CRITICAL FIX: Grant 'write' permissions so the action can push commits back to the repo
10+ permissions :
11+ contents : write
812
913jobs :
1014 execute-search :
11- runs-on : ubuntu-latest
15+ runs-on : ubuntu-24.04
1216 steps :
1317 - name : Checkout repository
1418 uses : actions/checkout@v4
15-
19+ with :
20+ token : ${{ secrets.GITHUB_TOKEN }}
21+
1622 - name : Set up Python 3.12
1723 uses : actions/setup-python@v5
1824 with :
1925 python-version : ' 3.12'
2026 cache : ' pip'
2127 cache-dependency-path : ' scripts/github/workflows/requirements.txt'
22-
28+
2329 - name : Install dependencies
2430 run : |
2531 python -m pip install --upgrade pip
2632 python -m pip install -r scripts/github/workflows/requirements.txt
27-
33+
2834 - name : Run Search Script
2935 env :
3036 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
31- WORKER_API_URL : ${{ secrets.WORKER_API_URL }} # Add this to your Repo Secrets
37+ WORKER_API_URL : ${{ secrets.WORKER_API_URL }}
3238 run : python scripts/github/workflows/search_repos.py
33-
34- - name : Upload Search Results Artifact
35- uses : actions/upload-artifact@v4
39+
40+ # 🚀 NEW: Auto-commit the results.json file back into the repository
41+ - name : Commit and Push Results Locally
42+ uses : stefanzweifel/git-auto-commit-action@v5
3643 with :
37- name : search-results-json
38- path : results.json # The script now saves here
39- if-no-files-found : error
44+ commit_message : " chore(bot): update daily github discovery results"
45+ file_pattern : " results.json"
46+ commit_user_name : " github-actions[bot]"
47+ commit_user_email : " 41898282+github-actions[bot]@users.noreply.github.com"
0 commit comments