From e994fac3d1100750346f5ef5b990d08e19b9cd49 Mon Sep 17 00:00:00 2001 From: Jared Watts Date: Fri, 14 Aug 2026 13:21:03 -0700 Subject: [PATCH] fix(ci): clean /homeless-shelter before Renovate's Nix commands Nix runs the post-build hook only after a build succeeds, so a failed build leaves /homeless-shelter behind and every Nix command after it fails the purity check instead of doing its work. This commit has the crossplane-nix launcher clean the directory on the way in as well. We keep the post-build hook because it cleans up between builds within a single Nix invocation, which the launcher that only runs once before the Nix invocation can't do. Signed-off-by: Jared Watts --- .github/renovate-entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/renovate-entrypoint.sh b/.github/renovate-entrypoint.sh index d6587dc..4d24905 100755 --- a/.github/renovate-entrypoint.sh +++ b/.github/renovate-entrypoint.sh @@ -29,7 +29,8 @@ build-users-group = # One build at a time, so no build starts before we can clean up /homeless-shelter. max-jobs = 1 -# Removes /homeless-shelter after each build (see the hook script above). +# Removes /homeless-shelter after each successful build. The crossplane-nix launcher covers any +# failed builds this misses. post-build-hook = /usr/local/bin/nix-clean-homeless-shelter # Use the Crossplane Cachix cache to download pre-built binaries from CI. @@ -43,6 +44,8 @@ EOF # and the config it reads. cat >/usr/local/bin/crossplane-nix <<'EOF' #!/bin/bash +# ensure any leftover /homeless-shelter from a failed build is cleaned up before we start +/usr/local/bin/nix-clean-homeless-shelter exec env NIX_CONF_DIR=/etc/nix /usr/bin/nix "$@" EOF chmod +x /usr/local/bin/crossplane-nix