update the SCA vul #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request Checker | |
on: | |
push: | |
branches: [ main, devsecops ] | |
pull_request: | |
branches: [ main, dev ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
TEST_DATABASE_PREFIX: test_ | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: github_actions | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Unit tests and Linters | |
run: | | |
# Unit Test | |
python manage.py test | |
# Code Formatter | |
black --check . | |
# Import sort | |
isort --check-only . | |
# Lint Flake8 | |
flake8 . | |
- name: Test SCA Vulnerabilities | Static Composition Analysis | |
run: | | |
pyraider check -f requirements.txt | |
y | pyraider autofix | |
- name: Check Package License | |
run: | | |
pip-licenses --format=json > licenses.json | |
./scripts/run-license-compliance.sh | |