Skip to content

Commit 077ec09

Browse files
committed
#996: Fix python_setup/install_tool.sh
When the script executed on a runner which does not have python2, script incorrectly execute the code inside the if condition. This script runs using /bin/sh in Ubuntu and cause the problem. Fix for this issue to use different syntax in output redirection. Issue is reproduced using running the job on ubunutu container. Fix also verified in the action https://github.com/cdivitotawela/codeql-issue/actions/runs/2038007502
1 parent 4d6e9c0 commit 077ec09

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python-setup/install_tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ python3 -m pip install --user 'virtualenv<20.11'
2828
python3 -m pip install --user poetry!=1.0.10
2929
python3 -m pip install --user pipenv
3030

31-
if command -v python2 &> /dev/null; then
31+
if command -v python2 >/dev/null 2>&1; then
3232
# Setup Python 2 dependency installation tools.
3333
# The Ubuntu 20.04 GHA environment does not come with a Python 2 pip
3434
curl --location --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2

0 commit comments

Comments
 (0)