name: Fetch Reddit Blog Posts on: workflow_dispatch: # run manually from the Actions tab schedule: - cron: "0 4 * * 1" # every Monday at 04:00 UTC jobs: fetch: runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout Repository uses: actions/checkout@v4 with: ref: dev - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 23 - name: Fetch Reddit post content run: node scripts/fetch-reddit-posts.mjs - name: Commit updated blog content run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add src/content/blog/ if git diff --cached --quiet; then echo "No changes to commit." else git commit -m "chore(blog): refresh Reddit post content [skip ci]" git push fi