From b168eee469ca25ffe6550995996db6d90b9702b4 Mon Sep 17 00:00:00 2001
From: Florian Bruhin <me@the-compiler.org>
Date: Fri, 20 Nov 2020 16:48:43 +0100
Subject: [PATCH] Make sure a Python 2 pip is installed

In the README of this repo, it's suggested to use the `ubuntu-latest` environment.
That environment will soon be upgraded to Ubuntu 20.04: https://github.com/actions/virtual-environments/issues/1816

As pointed out in that issue, the updated image comes without a Python 2 pip preinstalled:

    Setup Python dependencies
    /home/runner/work/_actions/github/codeql-action/v1/python-setup/install_tools.sh
    [...]
      + python2 -m pip install --user --upgrade pip setuptools wheel
      /usr/bin/python2: No module named pip
    Warning: Unable to download and extract the tools needed for installing the python dependecies. You can call this action with 'setup-python-dependencies: false' to disable this process.
---
 python-setup/install_tools.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/python-setup/install_tools.sh b/python-setup/install_tools.sh
index b5a6e8dce..583e45a8a 100755
--- a/python-setup/install_tools.sh
+++ b/python-setup/install_tools.sh
@@ -10,6 +10,10 @@ set -e
 # subsequent actions in the current job, and not the current action.
 export PATH="$HOME/.local/bin:$PATH"
 
+# The Ubuntu 20.04 GHA environment does not come with a Python 2 pip
+curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
+python2 get-pip.py
+
 python2 -m pip install --user --upgrade pip setuptools wheel
 python3 -m pip install --user --upgrade pip setuptools wheel