Update README with recent blog posts #109
This file contains 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 README with recent blog posts | |
on: | |
schedule: | |
- cron: '0 */12 * * *' # Run every 12 hours | |
workflow_dispatch: | |
push: | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
repository: ${{ github.repository }} | |
fetch-depth: 1 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install feedparser | |
- name: Update README | |
run: python update_readme.py | |
- name: Check for changes | |
id: git-check | |
run: | | |
git status | |
git diff | |
git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
if: steps.git-check.outputs.changes == 'true' | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add profile/README.md | |
git commit -m "Updated README with latest blog posts" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: No changes | |
if: steps.git-check.outputs.changes != 'true' | |
run: echo "No changes to commit" |