Trickest CVE Monitor And Deploy #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trickest CVE Monitor And Deploy | |
permissions: | |
contents: write | |
on: | |
schedule: | |
- cron: '0 * * * *' # 每小时检查一次 | |
workflow_dispatch: | |
jobs: | |
monitor-fork: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out this repository | |
uses: actions/checkout@v4 | |
- name: Check for updates in upstream repository | |
run: | | |
git clone https://github.com/trickest/cve trickest-cve | |
cd trickest-cve | |
git fetch | |
UPDATES=$(git log HEAD..origin/main --oneline) | |
if [ -n "$UPDATES" ]; then | |
echo "New updates detected. Forking repository." | |
gh repo fork trickest/cve --clone=true --remote=true | |
else | |
echo "No updates detected." | |
exit 0 | |
fi | |
- name: Generate Docsify Site | |
run: | | |
cd trickest-cve | |
mkdir docs | |
rsync -av --include='[0-9][0-9][0-9][0-9]/' --include='[0-9][0-9][0-9][0-9]/*.md' --exclude='*' --exclude="docs/" --exclude="summary_html/" . docs/ | |
echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=/docs/README.html" /></head></html>' > index.html | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./trickest-cve/docs |