Skip to content

Commit 809bab2

Browse files
authored
fix(ci): disable checkout clean on self-hosted runners (#2733)
## Summary - The `sudo rm -rf` approach from #2732 fails because the self-hosted WSL runner lacks passwordless sudo (`sudo: a terminal is required to read the password`). - Replace it by setting `clean: ${{ matrix.runs-on != 'self-hosted' }}` on `actions/checkout`, so checkout skips its built-in workspace clean on self-hosted runners and no longer fails with EACCES on root-owned Podman overlay files. - GitHub-hosted runners continue to get `clean: true` as before. ## Test plan - [ ] Verify the WSL CI job passes (checkout no longer fails with EACCES or sudo password prompt) - [ ] Verify Linux and macOS jobs are unaffected (`clean: true` still applies to non-self-hosted runners) Made with [Cursor](https://cursor.com)
1 parent d68efce commit 809bab2

File tree

2 files changed

+13
-35
lines changed

2 files changed

+13
-35
lines changed

.config/dictionary.txt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ ANSTRAT
22
Anson
33
CICD
44
CMDB
5-
Cachi
65
Customizer
76
DEEPSEEK
87
Elio’s
@@ -12,7 +11,6 @@ Fqcn
1211
Fqcns
1312
Interactable
1413
KUBEDOCK
15-
Konflux
1614
LIGHTSPEED
1715
LLMPROVIDER
1816
Lightspeed
@@ -31,24 +29,21 @@ SSOT
3129
Towncrier
3230
WSLENV
3331
antsibull
34-
appstudio
3532
bfnrt
36-
buildah
3733
charliermarsh
3834
checode
39-
clamav
4035
codeclimate
4136
codespell
4237
commitlint
4338
contentmatches
44-
coverity
4539
cpython
4640
dbaeumer
4741
dedupe
4842
deepseek
4943
dirmngr
5044
esbenp
5145
eslintcache
46+
ffdx
5247
fixturenames
5348
fqcn
5449
genai
@@ -60,7 +55,6 @@ hostsvars
6055
inetpub
6156
issuetracker
6257
knip
63-
konflux
6458
lcovonly
6559
lextudio
6660
libgbm
@@ -70,7 +64,6 @@ lightspeed
7064
ligthspeed
7165
lineinfile
7266
llmprovider
73-
longrepr
7467
microdnf
7568
myorg
7669
noconfirm
@@ -80,24 +73,18 @@ nqry
8073
ollama
8174
ovsx
8275
pacman
83-
pipelinesascode
8476
prek
8577
primevue
8678
priyamsahoo
8779
progressspinner
8880
pycobertura
8981
pydoclint
9082
pyvenv
91-
quasis
9283
relogin
93-
reprentries
94-
reprfileloc
95-
reprtraceback
9684
reshim
9785
rhcustom
9886
rhsso
9987
seealso
100-
shiki
10188
sonarcloud
10289
sonarqube
10390
summ
@@ -109,7 +96,6 @@ thumbsup
10996
timonwong
11097
tomaciazek
11198
tombi
112-
tomjs
11399
tomlsort
114100
towerhost
115101
tsup

.github/workflows/ci.yaml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -282,30 +282,22 @@ jobs:
282282
SKIP_PODMAN: 1
283283
SKIP_DOCKER: 1
284284
steps:
285-
- name: Remove root-owned container overlays (self-hosted)
286-
if: matrix.runs-on == 'self-hosted'
287-
run: |
288-
target="$GITHUB_WORKSPACE/out/als/tmp/home/.local/share/containers"
289-
290-
if [ -e "$target" ] || [ -L "$target" ]; then
291-
resolved_workspace="$(readlink -f "$GITHUB_WORKSPACE")"
292-
resolved_target="$(readlink -f "$target")"
293-
294-
case "$resolved_target" in
295-
"$resolved_workspace"/*)
296-
sudo rm -rf -- "$resolved_target"
297-
;;
298-
*)
299-
echo "Refusing to delete path outside GITHUB_WORKSPACE: $resolved_target"
300-
exit 1
301-
;;
302-
esac
303-
fi
304-
285+
# Self-hosted runners may retain root-owned files from previous
286+
# container builds (e.g. Podman overlays under out/als/tmp/).
287+
# Disable checkout's built-in clean so it does not fail with
288+
# EACCES when it cannot remove those files.
305289
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
306290
with:
307291
fetch-depth: 0 # we need tags for dynamic versioning
308292
show-progress: false
293+
clean: ${{ matrix.runs-on != 'self-hosted' }}
294+
295+
- name: Clean workspace on self-hosted runner
296+
if: matrix.runs-on == 'self-hosted'
297+
run: |
298+
set -euxo pipefail
299+
git reset --hard HEAD
300+
git clean -ffdx -e out/als/tmp/
309301
310302
- name: Run setup steps (composite action)
311303
uses: ./.github/actions/setup

0 commit comments

Comments
 (0)