Skip to content

Generate Markdown on Schedule #11745

Generate Markdown on Schedule

Generate Markdown on Schedule #11745

Workflow file for this run

name: Generate Markdown on Schedule
on:
schedule:
- cron: '*/15 * * * *' # 每五分钟运行一次
workflow_dispatch: # 手动触发
jobs:
update-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
persist-credentials: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Generate Markdown file
run: |
python scripts/generate_markdown.py
- name: Commit Markdown file
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add output.md
if git diff-index --quiet HEAD; then
echo "No changes to commit"
else
git commit -m "Update output.md on schedule"
git push
fi