Skip to content

Sync Medium Articles #6

Sync Medium Articles

Sync Medium Articles #6

Workflow file for this run

name: Sync Medium Articles
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Allows manual triggering
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }} # Use your PAT for checkout
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install feedparser markdown requests beautifulsoup4
- name: Fetch and save Medium articles
run: |
python .github/scripts/fetch_medium_articles.py
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git diff --quiet && git diff --staged --quiet || git commit -m "Update Medium articles [skip ci]"
git push
env:
# Use the PAT for the push operation
GITHUB_TOKEN: ${{ secrets.PAT }}