-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (31 loc) · 1.2 KB
/
workflow-runs-purge.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
# Workflow automatically executed so that to clean up workflow runs pilling in the GitHub Actions tab
#
# By default, workflow runs older than 30 days (see 'retain_days' parameter) are removed, every day at
# midnight (see and 'cron' parameters, respectively). The workflow purges his own run to only keep
# 3 of them in a second step (see 'keep_minimum runs').
# A token with the necessary permission for deleting workflow runs must be provided or the 'github.token'
# can also be used.
name: Purge workflow runs automatically
on:
schedule:
# Execute the job every day at midnight
- cron: "0 0 * * *"
jobs:
del_runs:
runs-on: ubuntu-latest
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 30
keep_minimum_runs: 6
- name: Delete runs of purge workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
delete_workflow_pattern: "Purge workflow runs automatically"
retain_days: 3
keep_minimum_runs: 3