forked from ophub/kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (68 loc) · 1.94 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
#==========================================================================
# https://github.com/ophub/kernel
# Description: Delete older releases and workflows runs
#==========================================================================
name: Delete older releases and workflows
on:
repository_dispatch:
workflow_dispatch:
inputs:
del_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: false
delete_tags: false
delete_workflows: ${{ inputs.del_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 }}