Skip to content

Commit b3f3800

Browse files
committed
Fix pre-commit PATH issue in CI
After pip installs pre-commit, the executable is placed in ~/.local/bin which is not on PATH in the CI environment. Add ~/.local/bin to PATH after installing pre-commit to ensure the command is available.
1 parent af42337 commit b3f3800

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/evergreen/check_precommit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export EVERGREEN_MODE=true
1010
if ! command -v pre-commit >/dev/null 2>&1; then
1111
echo "Installing pre-commit..."
1212
pip install pre-commit
13+
# Add ~/.local/bin to PATH if it exists (pip installs scripts there)
14+
if [[ -d "${HOME}/.local/bin" ]]; then
15+
export PATH="${HOME}/.local/bin:${PATH}"
16+
fi
1317
fi
1418

1519
echo "Running pre-commit hooks..."

0 commit comments

Comments
 (0)