Nightly Hacker News Simulator Content Update #45
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: 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 |