Update Blog Posts #101
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 Blog Posts | |
on: | |
schedule: | |
# Runs every day at midnight | |
- cron: '0 0 * * *' | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm install axios rss-parser | |
- name: Update README with latest blog posts | |
run: node scripts/update-readme.js | |
- name: Commit and push if changed | |
run: | | |
git config --global user.email "github-actions@github.com" | |
git config --global user.name "GitHub Actions" | |
git add -A | |
git diff --quiet && git diff --staged --quiet || git commit -m "Update blog posts on README" | |
git push |