Skip to content

Commit

Permalink
add ci and pydantic wheel file
Browse files Browse the repository at this point in the history
  • Loading branch information
kelkawi-a committed Jun 13, 2024
1 parent 1240368 commit 9a73a74
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
pull_request:

jobs:
scan:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8' # Specify the Python version you need

- name: Install Trivy
run: |
python -m venv base_venv
source base_venv/bin/activate
pip install trivy
- name: Install and scan each wheel file
run: |
mkdir -p trivy_reports
for wheel in $(find . -name "*.whl"); do
package_name=$(basename "$wheel" | sed 's/-.*$//')
version=$(basename "$wheel" | sed 's/.*-\(.*\)-py.*.whl/\1/')
venv_name="${package_name}_${version}_venv"
python -m venv $venv_name
source $venv_name/bin/activate
pip install "$wheel"
trivy fs --exit-code 1 --severity HIGH,CRITICAL $venv_name/lib/python3.8/site-packages > "trivy_reports/${package_name}_${version}_report.txt"
deactivate
done
- name: Upload Trivy scan reports
if: always()
uses: actions/upload-artifact@v2
with:
name: trivy-scan-reports
path: trivy_reports/
Binary file added pydantic-2.7.4-py3-none-any.whl
Binary file not shown.

0 comments on commit 9a73a74

Please sign in to comment.