Repository navigation
Daily GitHub Trending Tracker #35
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: Daily GitHub Trending Tracker | |
| on: | |
| schedule: | |
| # Runs twice every day at 00:20 UTC and 12:20 UTC (off-peak minute prevents GitHub scheduler delays) | |
| - cron: '20 0,12 * * *' | |
| workflow_dispatch: # Allows manual run anytime from GitHub Actions tab with 1 click | |
| permissions: | |
| contents: write | |
| jobs: | |
| track-trending: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run Trending Intelligence Engine | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| python engine.py | |
| - name: Commit and Push Updates | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A data/ archives/ feed.xml README.md | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "chore(auto): update trending intelligence [$(date -u +'%Y-%m-%d %H:%M UTC')]" | |
| git push origin main || (git pull --rebase -X ours origin main && git push origin main) | |
| fi |