Skip to content

Fetch GitHub Users Daily #270

Fetch GitHub Users Daily

Fetch GitHub Users Daily #270

Workflow file for this run

---
name: Fetch GitHub Users Daily
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
fetch-users:
if: github.repository == 'john-bampton/john-bampton.github.io'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main branch
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.14'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Run fetch.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
APP_ENV=production python fetch.py
- name: Run render.py
run: |
python render.py
- name: Check for changes
id: changes
run: |
if git diff --quiet docs/; then
echo "has_changes=false" >> "$GITHUB_OUTPUT"
else
echo "has_changes=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push changes
if: steps.changes.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs/
git commit -m "chore: daily update of GitHub faces data"
git push origin main