-
Notifications
You must be signed in to change notification settings - Fork 1.7k
120 lines (113 loc) · 3.16 KB
/
delete-older-releases-workflows.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#==========================================================================
# https://github.com/ophub/amlogic-s9xxx-openwrt
# Description: Delete older releases and workflows runs
#==========================================================================
name: Delete older releases and workflows
on:
repository_dispatch:
workflow_dispatch:
inputs:
delete_releases:
description: "Delete Releases file?"
required: true
default: true
type: boolean
delete_tags:
description: "Delete related Tags?"
required: false
default: true
type: boolean
prerelease_option:
description: "Whether to differentiate pre-release."
required: false
default: "all"
type: choice
options:
- all
- true
- false
releases_keep_latest:
description: "How many latest releases to keep."
required: false
default: "2"
type: choice
options:
- 30
- 20
- 10
- 9
- 8
- 7
- 6
- 5
- 4
- 3
- 2
- 1
- 0
releases_keep_keyword:
description: "Keyword of the keep releases."
required: false
default: "v0/_save_/kernel_"
delete_workflows:
description: "Delete workflows records?"
required: true
default: true
type: boolean
workflows_keep_day:
description: "Days to keep workflows."
required: false
default: "1"
type: choice
options:
- 30
- 20
- 10
- 9
- 8
- 7
- 6
- 5
- 4
- 3
- 2
- 1
- 0
workflows_keep_keyword:
description: "keywords for keep workflows."
required: false
default: ""
out_log:
description: "Output detailed JSON logs."
required: false
default: true
type: boolean
env:
TZ: America/New_York
jobs:
build:
runs-on: ubuntu-22.04
if: ${{ github.event.repository.owner.id }} == ${{ github.event.sender.id }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialization environment
id: init
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo timedatectl set-timezone "${TZ}"
echo "status=success" >> ${GITHUB_OUTPUT}
- name: Delete releases and workflows runs
uses: ophub/delete-releases-workflows@main
with:
delete_releases: ${{ inputs.delete_releases }}
delete_tags: ${{ inputs.delete_tags }}
prerelease_option: ${{ inputs.prerelease_option }}
releases_keep_latest: ${{ inputs.releases_keep_latest }}
releases_keep_keyword: ${{ inputs.releases_keep_keyword }}
delete_workflows: ${{ inputs.delete_workflows }}
workflows_keep_day: ${{ inputs.workflows_keep_day }}
workflows_keep_keyword: ${{ inputs.workflows_keep_keyword }}
out_log: ${{ inputs.out_log }}
gh_token: ${{ secrets.GITHUB_TOKEN }}