Merge pull request #217834 from yaxitech/gh-runner-workdir-clean

nixos/github-runners: clean `workDir` as root
This commit is contained in:
Aaron Andersen 2023-02-26 08:05:05 -05:00 committed by GitHub
commit d8c0a9204a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"