-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
217 lines (170 loc) · 5.71 KB
/
action.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: More Space Action
description: "Aggressively makes space in a GitHub runner"
branding:
color: red
icon: trash-2
inputs:
#
# Removing stuff
#
additional-apt-patterns:
description: |
Additional patterns to autopurge with apt.
> [!WARNING]
> This single string will be split according to bash string splitting semantics.
required: false
default: ""
enable-remove-default-apt-patterns:
description: |
Enable the built-in list of patterns to autopurge.
This effectively disables autopurging if disabled, when no additional patterns are provided.
required: false
default: true
additional-space-hogs:
description: |
Additional paths to remove.
> [!WARNING]
> This single string will be split according to bash string splitting semantics.
required: false
default: ""
enable-remove-default-space-hogs:
description: |
Enable the built-in list of space hogs to remove.
required: false
default: true
enable-remove-non-package-usr:
description: |
Enable removing some content from `/usr/` that is not managed by the package manager.
(This will not remove `/usr/local` content.)
required: false
default: true
enable-remove-default-home-folder-hogs:
description: |
Enable the built-in list of home folder hogs to remove.
required: false
default: true
enable-remove-home-folder-hogs:
description: |
Enable removing some large content from the different `/home/` folders.
required: false
default: true
enable-remove-usr-local:
description: |
Enable removing `/usr/local` entirely. It is not managed by the package manager.
required: false
default: true
enable-docker-prune-all:
description: |
Enable pruning all docker images from system.
Some older images shipped with around 2.5GiB of wasted space from docker images.
required: false
default: true
#
# Disk harmonization
#
enable-second-drive-harmonization:
description: |
When enabled, if a second drive is attached to the runner (it likely is with GitHub's runners),
the attached drive will be configured to work similarly on all systems:
- The secondary disk (if needed) will be formatted and mounted to `/mnt`
- Swap file will be put in the preferred location (see: `swapfile-location`)
This option, in itself, saves no space, but ensures further steps can run under an expected disk layout.
required: false
default: true
enable-swapfile:
description: |
When harmonizing the drives, the existing swapfile will be removed.
When this option is enabled, a swapfile is created back in the system.
This option can be used to effectively disable the swapfile entirely.
A swapfile is used by default, just like GitHub's runners do by default.
require: false
default: true
swapfile-location:
description: |
Determine where the swapfile should be created.
GitHub's runners defaults differ:
- AArch64: /swapfile
- x86_64: /mnt/swapfile
required: false
default: /swapfile
swapfile-size:
description: |
Determine the swapfile size.
GitHub's runners defaults differ:
- AArch64: 3GB
- x86_64: 4GB
The value is passed to fallocate.
required: false
default: 4GiB
#
# Expanding storage for a specific folder
#
enable-lvm-span:
description: |
When enabled, files will be created at the listed locations,
The mountpoint will be left untouched, meaning that chmod or chown is likely to be needed to make use of it in your actions.
> [!NOTE]
> This option makes no sense to enable without `enable-second-drive-harmonization` being enabled.
> [!WARNING]
> If setting-up the lvm span fails, at any point, the action will fail.
>
> Enabling this option means it is necessary for the span to be created.
required: false
default: false
lvm-span-mountpoint:
description: |
Loction the lvm span will be mounted as
required: false
default: /misc
lvm-span-mountpoints:
description: |
Mountpoints under which a file for the LVM span will be created.
required: false
default: / /mnt
lvm-span-default-free-space:
description: |
This numeric option describes the amount of bytes that will be left free by default on drives with an LVM span.
The default value leaves 100MiB free on any given disk.
See also: `lvm-span-free-space`
required: false
default: 104857600
lvm-span-free-space:
description: |
JSON object listing amount of free space to be left on specific mountpoints.
The default leaves 1GiB free on the rootfs.
See also: `lvm-span-default-free-space`
required: false
default: |
{
"/": "1073741824"
}
#
# Misc. configuration
#
verbose:
description: |
When enabled, this action may be overly verbose.
required: false
default: false
dry-run:
description: |
When enabled, this action will stub out all system altering commands.
required: false
default: false
runs:
using: "composite"
steps:
- name: more space
#
# > If the action is written using a composite, then it will not automatically get INPUT_<VARIABLE_NAME>.
# - https://docs.github.com/en/actions/sharing-automations/creating-actions/metadata-syntax-for-github-actions#inputs
#
# ¯\_(ツ)_/¯
#
# Let's use JSON instead.
env:
INPUTS_JSON: ${{ toJSON(inputs) }}
shell: bash
run: |
# The `more space action` starts here...
sudo -E bash ${{ github.action_path }}/get-more-space.sh