Skip to content

Commit 3f31375

Browse files
committed
help us
1 parent 6c892dc commit 3f31375

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

.github/workflows/unit-sec-test.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,17 @@ jobs:
2222
stupid_snyk:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@master
26-
- uses: snyk/actions/setup@master
27-
- uses: actions/setup-python@master
28-
25+
- uses: actions/checkout@main
26+
2927
- name: Install dependencies
3028
run: |
3129
pip install -r requirements.txt
3230
python -m pip install --upgrade pip
33-
34-
- name: Authenticate with Snyk
35-
run: snyk auth ${{ secrets.SNYK_TOKEN }}
36-
37-
- name: Snyk test
38-
run: snyk test
31+
32+
- name: Run Snyk to check for vulnerabilities
33+
uses: snyk/actions/python@master
34+
with:
35+
args: --file=requirements.txt
3936
env:
4037
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
4138

@@ -97,12 +94,20 @@ jobs:
9794
- name: Checkout
9895
uses: actions/checkout@v4
9996

97+
# Build and Tag Image
98+
# Run Docker Image in detached mode
99+
- name: Build Docker Image
100+
run: |
101+
docker build -t awesome-fastapi:${{ github.sha }} .
102+
docker run -d -p 8000:8000 awesome-fastapi:${{ github.sha }}
103+
104+
# Run OWASP ZAP scan
100105
- name: zap scan
101106
uses: zaproxy/action-api-scan@v0.9.0
102107
with:
103108
token: ${{ secrets.GITHUB_TOKEN }}
104109
docker_name: 'ghcr.io/zaproxy/zaproxy:stable'
105110
format: openapi
106-
target: '<fast-api-url>'
111+
target: 'http://localhost:8000'
107112
rules_file_name: '.zap/rules.tsv'
108113
cmd_options: '-a'

0 commit comments

Comments
 (0)