Skip to content

Nightly Hacker News Simulator Content Update #45

Nightly Hacker News Simulator Content Update

Nightly Hacker News Simulator Content Update #45

name: Nightly Hacker News Simulator Content Update
on:
schedule:
# Run every night at midnight UTC
- cron: '0 0 * * *'
workflow_dispatch:
# Allow manual triggering
permissions:
contents: write
jobs:
update-content:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Fetch and update content
run: python3 scripts/automation/update_hn_content.py
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Check if there are changes
if [[ -n $(git status -s data/content/hacker-news-posts.json) ]]; then
git add data/content/hacker-news-posts.json
git commit -m "🤖 Nightly auto-update of Hacker News Simulator content [skip ci]"
git push
else
echo "No changes to commit."
fi