-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.57 KB
/
schedule-cleanup.yaml
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
46
47
48
---
name: Schedule - Cleanup
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
cleanup_runs:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Generate Token
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1
id: app-token
with:
app-id: ${{ secrets.LAB_ASSISTANT_APP_ID }}
private-key: ${{ secrets.LAB_ASSISTANT_APP_KEY }}
- name: Cleanup workflow stale runs
uses: Mattraks/delete-workflow-runs@4c9f24749b7996562658e3d6e10662489e22caca # v2
with:
token: "${{ steps.app-token.outputs.token }}"
repository: "${{ github.repository }}"
retain_days: "0"
keep_minimum_runs: "0"
delete_run_by_conclusion_pattern: "cancelled,skipped"
- name: Cleanup workflow success runs
uses: Mattraks/delete-workflow-runs@4c9f24749b7996562658e3d6e10662489e22caca # v2
with:
token: "${{ steps.app-token.outputs.token }}"
repository: "${{ github.repository }}"
retain_days: "0"
keep_minimum_runs: "5"
delete_run_by_conclusion_pattern: "success"
- name: Clenaup workflow failure runs
uses: Mattraks/delete-workflow-runs@4c9f24749b7996562658e3d6e10662489e22caca # v2
with:
token: "${{ steps.app-token.outputs.token }}"
repository: "${{ github.repository }}"
retain_days: "0"
keep_minimum_runs: "3"
delete_run_by_conclusion_pattern: "action_required,failure"