[CRAVEX] SCA Integrations: ORT (part.1) #2
Workflow file for this run
This file contains hidden or 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: Generate SBOM with ORT and load into ScanCode.io | |
| # This workflow: | |
| # 1. Generates a CycloneDX SBOM for a requirement file using ORT. | |
| # 2. Uploads the SBOM as a GitHub artifact for future inspection. | |
| # 3. Loads the SBOM into ScanCode.io for further analysis. | |
| # 4. Runs assertions to verify that the SBOM was properly processed in ScanCode.io. | |
| # | |
| # It runs on demand, and once a week (scheduled). | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| env: | |
| IMAGE_REFERENCE: "python:3.13.0-slim" | |
| jobs: | |
| generate-and-load-sbom: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Create requirements.txt | |
| run: | | |
| cat << 'EOF' > requirements.txt | |
| amqp==5.1.1 | |
| appdirs==1.4.4 | |
| asgiref==3.5.2 | |
| urllib3==1.26.0 | |
| EOF | |
| - name: Run GitHub Action for ORT | |
| uses: oss-review-toolkit/ort-ci-github-action@v1 | |
| - name: Import SBOM into ScanCode.io | |
| uses: aboutcode-org/scancode-action@main | |
| with: | |
| pipelines: "load_sbom" | |
| inputs-path: "${{ env.ORT_RESULTS_PATH }}/bom.cyclonedx.json" | |
| scancodeio-repo-branch: "main" | |
| - name: Verify SBOM Analysis Results in ScanCode.io | |
| shell: bash | |
| run: | | |
| scanpipe shell --command "from scanpipe.models import DiscoveredPackage, DiscoveredDependency; package_manager = DiscoveredPackage.objects; print(package_manager.count()); print(package_manager.vulnerable().count()); print(DiscoveredDependency.objects.count())" |