Cleanup Old Artifacts #30
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 Old Artifacts | |
| on: | |
| workflow_dispatch: # 支持手动触发 | |
| schedule: | |
| - cron: '0 0 * * 0' # 每周日 00:00 UTC 自动运行 | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Delete old artifacts | |
| uses: dawidd6/action-delete-old-artifacts@v3 | |
| with: | |
| # 删除超过 7 天的 artifacts | |
| days: 3 | |
| # 可选:保留每个名称最近 N 个(防误删) | |
| keep_latest: 2 | |
| # 只删除非预发布 tag 对应的 artifacts(可选) | |
| # exclude_pre_releases: true | |
| # 使用默认 token | |
| token: ${{ secrets.GITHUB_TOKEN }} |