Skip to content

Commit 0d815cf

Browse files
Update delete-workflow-runs.yml
Adjusted to the new one from https://github.com/marketplace/actions/delete-workflow-runs
1 parent b04e895 commit 0d815cf

1 file changed

Lines changed: 25 additions & 23 deletions

File tree

.github/workflows/delete-workflow-runs.yml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@ on:
33
workflow_dispatch:
44
inputs:
55
days:
6-
description: 'Days-worth of runs to keep for each workflow'
7-
required: true
8-
default: '7' # default value is "30"
6+
description: "Days to retain runs"
7+
default: "30"
98
minimum_runs:
10-
description: 'Minimum runs to keep for each workflow'
11-
required: true
12-
default: '5' # default value is "6"
9+
description: "Minimum runs to keep"
10+
default: "6"
11+
use_daily_retention:
12+
description: "Enable daily retention (keep minimum runs per day instead of overall)"
13+
default: "false"
14+
type: choice
15+
options:
16+
- "false"
17+
- "true"
1318
delete_workflow_pattern:
14-
description: 'Name or filename of the workflow (if not set, all workflows are targeted)'
15-
required: false
16-
default: 'Build and Release uYouEnhanced' # default value is ""
19+
description: "Workflow name or filename (omit for all). Use `|` to separate multiple filters (e.g. 'build|deploy')."
1720
delete_workflow_by_state_pattern:
18-
description: 'Filter workflows by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually'
19-
required: true
21+
description: "Workflow state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually"
2022
default: "ALL"
2123
type: choice
2224
options:
@@ -26,8 +28,7 @@ on:
2628
- disabled_inactivity
2729
- disabled_manually
2830
delete_run_by_conclusion_pattern:
29-
description: 'Remove runs based on conclusion: action_required, cancelled, failure, skipped, success'
30-
required: true
31+
description: "Run conclusion: action_required, cancelled, failure, skipped, success"
3132
default: "ALL"
3233
type: choice
3334
options:
@@ -39,14 +40,14 @@ on:
3940
- skipped
4041
- success
4142
dry_run:
42-
description: 'Logs simulated changes, no deletions are performed'
43-
required: false
44-
45-
# schedule:
46-
# - cron: '0 0 * * *'
47-
43+
description: "Simulate deletions"
44+
default: "false"
45+
type: choice
46+
options:
47+
- "false"
48+
- "true"
4849
jobs:
49-
del_runs:
50+
delete-runs:
5051
runs-on: ubuntu-latest
5152
permissions:
5253
actions: write
@@ -59,12 +60,13 @@ jobs:
5960
repository: ${{ github.repository }}
6061
retain_days: ${{ github.event.inputs.days }}
6162
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
63+
use_daily_retention: ${{ github.event.inputs.use_daily_retention }}
6264
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }}
6365
delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }}
6466
delete_run_by_conclusion_pattern: >-
6567
${{
66-
startsWith(github.event.inputs.delete_run_by_conclusion_pattern, 'Unsuccessful:')
67-
&& 'action_required,cancelled,failure,skipped'
68-
|| github.event.inputs.delete_run_by_conclusion_pattern
68+
startsWith(github.event.inputs.delete_run_by_conclusion_pattern, 'Unsuccessful:') &&
69+
'action_required,cancelled,failure,skipped' ||
70+
github.event.inputs.delete_run_by_conclusion_pattern
6971
}}
7072
dry_run: ${{ github.event.inputs.dry_run }}

0 commit comments

Comments
 (0)