update-projects #6
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-projects | |
on: | |
schedule: | |
- cron: '0 0 * * 0' # Runs at 00:00 UTC every Sunday | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
update-stats: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Needed for git history | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.13' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyyaml requests | |
- name: Update project details | |
run: python scripts/update-projects.py "data/projects.yml" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit changes | |
if: success() | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
git add data/projects.yml | |
git diff --quiet && git diff --staged --quiet || git commit -m "Auto-update GitHub project details." | |
git push |