Skip to content

action

action #7

Workflow file for this run

name: Update README and All Articles
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
- 'docs/all-articles.md'
workflow_dispatch:
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Generate README and all-articles
run: python scripts/generate_readme.py --target both
- name: Check if files changed
id: check_changes
run: |
if git diff --quiet README.md docs/all-articles.md; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push if changed
if: steps.check_changes.outputs.changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md docs/all-articles.md
git commit -m "docs: auto-update README and all-articles"
git push