nixos/github-runners: clean workDir as root
Purge contents of `workDir` as root to also allow the removal of files marked as read-only. It is easy to create read-only files in `workDir`, e.g., by copying files from the Nix store.
This commit is contained in:
@@ -124,6 +124,8 @@ in
|
||||
# The state directory is entirely empty which indicates a first start
|
||||
copy_tokens
|
||||
fi
|
||||
# Always clean workDir
|
||||
find -H "$WORK_DIRECTORY" -mindepth 1 -delete
|
||||
'';
|
||||
configureRunner = writeScript "configure" ''
|
||||
if [[ -e "${newConfigTokenPath}" ]]; then
|
||||
@@ -159,9 +161,6 @@ in
|
||||
fi
|
||||
'';
|
||||
setupWorkDir = writeScript "setup-work-dirs" ''
|
||||
# Cleanup previous service
|
||||
${pkgs.findutils}/bin/find -H "$WORK_DIRECTORY" -mindepth 1 -delete
|
||||
|
||||
# Link _diag dir
|
||||
ln -s "$LOGS_DIRECTORY" "$WORK_DIRECTORY/_diag"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user