[新] 如何怎样 > GitHub > Rulesets > 如何在分支保护规则集中要求 PR 必须通过自己的 CI/工作流 (#111) #520
This file contains hidden or 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: 检查链接有效性 | |
| on: | |
| schedule: # 夜间执行 | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: # 手动执行 | |
| pull_request: # PR执行 | |
| push: # Push到main执行 | |
| branches: | |
| - main | |
| jobs: | |
| check-url: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/[email protected] | |
| - name: 设置 Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.x' | |
| - name: 安装依赖 | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r .action_scripts/Python/requirements.txt | |
| - name: 检查链接有效性 | |
| run: python ./.action_scripts/Python/link_checker.py |