Skip to content

Commit ee4c60e

Browse files
committed
Try to install requests if its missing
Signed-off-by: Andy Doan <andy@foundries.io>
1 parent 61d58bf commit ee4c60e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ runs:
2727
run: |
2828
set -eu
2929
30-
which python >/dev/null 2>&1 && exit 0
31-
echo "Python not found. Installing..."
30+
if python >/dev/null 2>&1 ; then
31+
if ! python -c "import requests" 2>/dev/null ; then
32+
echo "= Python requests not found. Installing with pip"
33+
python3 -m pip install requests
34+
fi
35+
exit 0
36+
fi
37+
echo "= Python not found. Installing..."
3238
3339
which apt >/dev/null 2>&1 || (echo "ERROR: This action requires 'apt'"; exit 1)
3440

0 commit comments

Comments
 (0)