From 4d8b5b87890c365f52615ce79f3547640ab537f2 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Mon, 9 Mar 2020 20:45:11 +0800 Subject: [PATCH] Use python -c to get the interpreter path hash The current implementation has compatibility problems due to it using commands only available on GNU Linux. Use an equivalent Python implementation for better support on Windows and macOS. See pypa/pip#7835. Co-Authored-By: Xavier Fernandez --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 990c3f1..92bbe9b 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-python@v1 - name: set PY - run: echo "::set-env name=PY::$((python --version --version && which python) | sha256sum | cut -d' ' -f1)" + run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" - uses: actions/cache@v1 with: path: ~/.cache/pre-commit