-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (42 loc) · 1.35 KB
/
cleanup-actions.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
name: "Cleanup - Actions"
on:
workflow_dispatch:
inputs:
days:
description: 'Retain days'
required: true
type: string
default: 30
minimum_runs:
description: 'Minimum runs to keep for each workflow'
required: true
type: string
default: 0
delete_workflow_pattern:
description: 'Name/filename of workflow. Default is all.'
required: false
type: string
delete_workflow_by_state_pattern:
description: 'Remove workflow by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually'
required: true
default: All
type: choice
options:
- All
- active
- deleted
- disabled_inactivity
- disabled_manually
jobs:
delete-runs:
name: "Delete old workflow runs"
runs-on: ubuntu-latest
steps:
- uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: ${{ github.event.inputs.days }}
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }}
delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }}