Skip to content

Update article link selection in fetch_and_parse_articles function #16

Update article link selection in fetch_and_parse_articles function

Update article link selection in fetch_and_parse_articles function #16

name: Update Articles
on:
push:
workflow_dispatch:
schedule:
- cron: '0 13 * * 5' # Run every Friday at 9 AM EST (13:00 UTC)
jobs:
update-articles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests beautifulsoup4 pandas pytz
- name: Run app.py
run: python app.py
- name: Check for changes
id: changes
run: |
if git diff --quiet articles.md; then
echo "::set-output name=changed::false"
else
echo "::set-output name=changed::true"
fi
- name: Commit changes
if: steps.changes.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add articles.md
git commit -m "Update articles.md"
- name: Push changes
if: steps.changes.outputs.changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_TOKEN }}