-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.sh
executable file
·48 lines (38 loc) · 1.3 KB
/
action.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
set -e;
THIS_SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`;
for envVar in ${!ACTION_*};
do
unset $envVar;
done;
for envVar in ${!GITHUB_*};
do
unset $envVar;
done;
for envVar in ${!INPUT_*};
do
unset $envVar;
done;
echo "##[group] Replacing http deb server with https one";
sudo find /etc/apt -name "*.list" -exec sed -i 's%http://deb.debian.org%https://mirrors.edge.kernel.org%g' {} \; ;
sudo find /etc/apt -name "*.list" -exec sed -i 's%http://azure.archive.ubuntu.com%https://mirrors.edge.kernel.org%g' {} \; ;
sudo find /etc/apt -name "*.list" -exec sed -i 's%http://dl.google.com%https://dl.google.com%g' {} \; ;
sudo apt-get update;
sudo apt-get install -y --reinstall apt-transport-https ca-certificates;
sudo apt-get update;
echo "##[endgroup]";
echo "##[group] A bit more secure prefs for gpg";
sudo apt-get install -y gnupg1-curl;
sudo mkdir -p /root/.gnupg;
sudo touch /root/.gnupg/gpg.conf;
sudo chmod -R 700 /root/.gnupg;
sudo su -c "cat ${THIS_SCRIPT_DIR}/gpg.conf >> /root/.gnupg/gpg.conf";
mkdir -p ~/.gnupg;
touch ~/.gnupg/gpg.conf;
chmod -R 700 ~/.gnupg;
cat ${THIS_SCRIPT_DIR}/gpg.conf >> ~/.gnupg/gpg.conf;
chmod -R 700 ~/.gnupg;
echo "##[endgroup]";
echo "##[group] A bit more secure prefs for pip";
sudo cp ${THIS_SCRIPT_DIR}/pip.conf /etc/;\
echo "##[endgroup]"