-
Notifications
You must be signed in to change notification settings - Fork 50
38 lines (33 loc) · 1 KB
/
Copy pathdelete-old-workflows.yml
File metadata and controls
38 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: delete old workflows
on:
schedule:
- cron: 0 0 * * 6
workflow_dispatch:
inputs:
releases_keep_latest:
description: '保留最新Releases数量'
required: true
default: '10'
type: choice
options: [30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
workflows_keep_day:
description: '保留Workflows记录天数'
required: true
default: '0'
type: choice
options: [30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Delete releases and workflows runs
uses: ophub/delete-releases-workflows@main
with:
delete_releases: true
delete_tags: true
releases_keep_latest: ${{inputs.releases_keep_latest || '10'}}
releases_keep_keyword: 'toolchain'
delete_workflows: true
workflows_keep_day: ${{inputs.workflows_keep_day || '30'}}
out_log: true
gh_token: ${{secrets.GITHUB_TOKEN}}