Cleanup Workflow Runs #9
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: Cleanup Workflow Runs | |
| on: | |
| workflow_dispatch: # 支持手动触发 | |
| schedule: | |
| - cron: "0 16 * * 6" # 每周日北京时间 00:00 (UTC 周六 16:00) | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Delete old workflow runs | |
| uses: Mattraks/delete-workflow-runs@v2 | |
| with: | |
| token: ${{ github.token }} | |
| repository: ${{ github.repository }} | |
| retain_days: 7 | |
| keep_minimum_runs: 2 | |
| permissions: | |
| actions: write # 允许删除工作流运行记录 |