-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
99 lines (83 loc) · 3.23 KB
/
action.yml
File metadata and controls
99 lines (83 loc) · 3.23 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
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
name: "GitHub Maintenance Action"
description: "Executing maintenance tasks on GitHub — delete old workflow runs, artifacts, and logs."
author: "Viascom Ltd liab. Co | Nikola Stanković <nikola.stankovic@viascom.email>"
inputs:
github_token:
description: "GitHub authentication token (usually pass: secrets.GITHUB_TOKEN)."
required: true
default: ${{ github.token }}
repository:
description: "Repository name in format 'owner/repo'."
required: true
default: ${{ github.repository }}
retention_days:
description: "Retention time in days for workflow runs to keep."
required: true
default: 31
keep_minimum_runs:
description: "Minimum number of latest workflow runs to always keep."
required: true
default: 5
# OPTIONAL INPUTS
github_base_url:
description: "GitHub API base URL. Defaults to public GitHub API."
required: false
default: "https://api.github.com"
delete_logs:
description: "If true, deletes only the logs of workflow runs. If false and delete_artifacts is also false, the entire workflow run will be deleted."
required: false
default: false
delete_artifacts:
description: "If true, deletes only the artifacts of workflow runs. If false and delete_logs is also false, the entire workflow run will be deleted."
required: false
default: false
actors:
description: "Comma-separated list of actors whose workflow runs to delete. If empty, no actor filtering is applied."
required: false
default: ""
branches:
description: "Comma-separated list of branches whose workflow runs to delete. If empty, no branch filtering is applied."
required: false
default: ""
events:
description: "Comma-separated list of workflow run events to delete. If empty, no event filtering is applied."
required: false
default: ""
statuses:
description: "Comma-separated list of workflow run statuses to delete. If empty, no status filtering is applied."
required: false
default: ""
keep_pull_requests:
description: "If true, pull request workflow runs will always be kept."
required: false
default: false
dry_run:
description: "If true, logs simulated changes but does not perform any deletions (artifacts, logs, or runs)."
required: false
default: false
debug:
description: "If true, enables debug logging."
required: false
default: false
runs:
using: "docker"
image: "docker://ghcr.io/viascom/github-maintenance-action:latest"
args:
- /etc/run_application.sh
- ${{ inputs.github_token }}
- ${{ inputs.github_base_url }}
- ${{ inputs.repository }}
- ${{ inputs.retention_days }}
- ${{ inputs.keep_minimum_runs }}
- ${{ inputs.delete_logs }}
- ${{ inputs.delete_artifacts }}
- ${{ inputs.actors }}
- ${{ inputs.branches }}
- ${{ inputs.events }}
- ${{ inputs.statuses }}
- ${{ inputs.keep_pull_requests }}
- ${{ inputs.dry_run }}
- ${{ inputs.debug }}
branding:
icon: "settings" # https://feathericons.com/ - https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#brandingicon
color: "purple" # The background color of the badge. Can be one of: white, yellow, blue, green, orange, red, purple, or gray-dark.