Fetch News Files #1
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: Fetch News Files | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Run daily at midnight UTC | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
fetch-news: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: autodocs | |
- name: Run news fetcher | |
run: | | |
chmod +x docs/scripts/fetch-news.sh | |
./docs/scripts/fetch-news.sh | |
- name: Commit and push if changes exist | |
run: | | |
git config --global user.name 'GitHub Actions Bot' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add docs/news/ | |
git diff --quiet && git diff --staged --quiet || (git commit -m "Auto-update news files" && git push origin autodocs) |