Skip to content

Fetch latest blog posts #6

Fetch latest blog posts

Fetch latest blog posts #6

name: Fetch latest blog posts
on:
schedule:
- cron: "0 0 1 * *"
permissions:
contents: write
jobs:
fetch_blog_posts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
check-latest: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install beautifulsoup4 requests lxml
- name: Fetch Latest Blog Posts
run: |
python ".github/script/fetch-blog-post.py" "https://t3l3sc0p3.github.io/feed.xml"
if [[ $(git status --porcelain) ]]; then
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Fetch latest blog posts"
git push
else
echo "No new posts found"
fi