-
-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (33 loc) · 1.03 KB
/
cleanup.yml
File metadata and controls
34 lines (33 loc) · 1.03 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
name: Cleanup
run-name: "${{ github.event.repository.name }} | Cleanup | ${{ github.run_id }} | ${{ github.event_name }}"
on:
schedule:
# Every day at midnight
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
minimum-runs:
description: 'Minimum number of recent workflow runs to retain'
required: false
type: number
default: 2
retain-days:
description: 'Number of days to retain workflow runs'
required: false
type: number
default: 5
jobs:
cleanup-runs:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@5bf9a1dac5c4d041c029f0a8370ddf0c5cb5aeb7 #v2.1
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
keep_minimum_runs: ${{ github.event.inputs.minimum-runs || 5 }}
check_pullrequest_exist: true
retain_days: ${{ github.event.inputs.retain-days || 5 }}