-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (42 loc) · 1.27 KB
/
security-check.yml
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
49
50
name: Security Check
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
security_check:
name: Security Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Miniconda
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
echo "source $HOME/miniconda/etc/profile.d/conda.sh" >> $HOME/.bashrc
source $HOME/.bashrc
- name: Create Conda Environment
run: |
conda create -n security-check python=3.10 -y
conda init bash
source $HOME/.bashrc
conda activate security-check
pip install -r requirements.txt
pip install safety
- name: Activate env and Check for Security Issues
run: |
source $HOME/miniconda/bin/activate security-check
safety check -r requirements.txt
- name: Cleanup
run: |
rm -f Miniconda3-latest-Linux-x86_64.sh