-
-
Notifications
You must be signed in to change notification settings - Fork 7
32 lines (29 loc) · 893 Bytes
/
delete_workflows.yml
File metadata and controls
32 lines (29 loc) · 893 Bytes
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
name: Delete old workflow runs
on:
schedule:
- cron: '0 0 * * 0'
# Weekly (every Sunday at midnight UTC)
workflow_dispatch:
inputs:
days:
description: 'Number of days of runs to retain.'
required: true
default: 30
minimum_runs:
description: 'Minimum number of runs to keep for each workflow.'
required: true
default: 6
jobs:
del_runs:
runs-on: ubuntu-latest
permissions:
actions: write # Necessary to delete workflow runs
contents: read # Necessary to read repository contents
steps:
- name: Delete workflow runs
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 }}