-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.23 KB
/
security.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
# This is the name of the workflow, it appears in the GitHub Actions tab
name: Security Checks
# The name for workflow runs generated from this workflow
run-name: Security Check on ${{ github.ref }} by @${{ github.actor }}
# This specifies the events that will trigger the workflow to run
on: [push, pull_request]
jobs:
setup:
uses: ./.github/workflows/setup_environment.yml
with:
python-version: '3.11'
# This job runs Bandit for security checks
bandit:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Bandit
run: pip install bandit
- name: Run Bandit
run: bandit -c pyproject.toml -r .
# This job runs Safety for security checks
safety:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Generate requirements.txt from Poetry
run: |
poetry export -f requirements.txt --output requirements.txt --without-hashes
- name: Install Safety
run: pip install safety
- name: Run Safety
run: safety check -r requirements.txt