diff --git a/scripts/check-each-commit.sh b/scripts/check-each-commit.sh index 6ae614ff4..1dca8cca0 100755 --- a/scripts/check-each-commit.sh +++ b/scripts/check-each-commit.sh @@ -12,4 +12,13 @@ if [[ "$(git log --pretty="%H %D" | grep "^[0-9a-f]*.* $1")" = "" ]]; then echo "It seems like the current checked-out commit is not based on $1" exit 1 fi + +# Keep build cache ephemeral for this run to avoid long-term disk growth. +TMP_GOCACHE=$(mktemp -d -t lnd-check-commit-gocache.XXXXXX) +cleanup() { + rm -rf "$TMP_GOCACHE" +} +trap cleanup EXIT +export GOCACHE="$TMP_GOCACHE" + git rebase --exec scripts/check-commit.sh $1