Skip to content

Feed Posts Parser

Feed Posts Parser #272

name: Feed Posts Parser
on:
workflow_dispatch: # Allows manual triggering
schedule:
# 每天凌晨5点运行一次
- cron: '0 21 * * *' # Runs daily at 21:00
jobs:
feed-parser:
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Feed Post Parser
uses: xaoxuu/feed-posts-parser@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
posts_count: 3 # 取 3 篇文章
# 重新生成一下JSON
- name: Generate data.json
uses: xaoxuu/issues2json@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
sort: 'posts-desc'
exclude_issue_with_labels: '审核中, 风险网站' # 具有哪些标签的issue不生成到JSON中
hide_labels: '白名单' # 这些标签不显示在前端页面
- name: Setup Git Config
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Commit and Push to output branch
run: |
git fetch origin output || true
git checkout -B output
git add --all
git commit -m "Update data from issues" || echo "No changes to commit"
git push -f origin output