-
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 1.96 KB
/
gc.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: GC
on:
schedule:
# Run on the 7th of every month at 11:13am UTC
- cron: "13 11 7 * *"
workflow_dispatch:
inputs:
retain_days:
description: Number of days to keep
required: true
default: 28
type: number
keep_minimum_runs:
description: Minimum runs to keep for each workflow
required: true
default: 10
type: number
delete_workflow_pattern:
description: "Name or filename of workflow (if not set, all workflows are targeted)"
required: false
type: string
delete_workflow_by_state_pattern:
description: Workflow state
required: true
default: ALL
type: choice
options:
- ALL
- active
- deleted
- disabled_inactivity
- disabled_manually
delete_run_by_conclusion_pattern:
description: Workflow conclusion
required: true
default: ALL
type: choice
options:
- ALL
- action_required
- cancelled
- failure
- skipped
- success
dry_run:
description: Dry run
required: false
type: boolean
jobs:
delete-runs:
name: Delete workflow runs
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: ${{ inputs.retain_days || 28 }}
keep_minimum_runs: ${{ inputs.keep_minimum_runs || 10 }}
delete_workflow_pattern: ${{ inputs.delete_workflow_pattern || null }}
delete_workflow_by_state_pattern: ${{ inputs.delete_workflow_by_state_pattern || 'ALL' }}
delete_run_by_conclusion_pattern: ${{ inputs.delete_run_by_conclusion_pattern || 'ALL' }}
dry_run: ${{ inputs.dry_run || null }}