mirror of
https://github.com/Mr-xn/Penetration_Testing_POC.git
synced 2026-05-28 09:45:31 +08:00
Add GitHub Actions workflow to update README with RSS
This commit is contained in:
@@ -0,0 +1,41 @@
|
|||||||
|
name: Update README with RSS
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 1 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-readme:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.11' # 推荐明确指定版本
|
||||||
|
|
||||||
|
# 创建并激活虚拟环境安装依赖
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install feedparser
|
||||||
|
|
||||||
|
# 在运行脚本时也使用该虚拟环境
|
||||||
|
- name: Run update script
|
||||||
|
run: |
|
||||||
|
source venv/bin/activate
|
||||||
|
python scripts/update_readme.py
|
||||||
|
|
||||||
|
- name: Commit and push changes
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add README.md
|
||||||
|
git diff --quiet && git diff --staged --quiet || (git commit -m "docs: auto update RSS [skip ci]" && git push)
|
||||||
Reference in New Issue
Block a user