chore: more tweaks #3
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: (DEMO) HeroDevs CLI Build and Scan Docker Image | |
| on: | |
| push: | |
| branches: ['chore/add_demo_docker_scan_workflows'] | |
| env: | |
| TRACKING_OPT_OUT: 'true' | |
| jobs: | |
| build-and-sbom: | |
| name: Build and Generate SBOM | |
| environment: demo | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install cdxgen | |
| run: npm install -g @cyclonedx/cdxgen | |
| - name: Build Docker image | |
| run: | | |
| docker build -f ./ci/image.Dockerfile -t herodevs/eol-scan:local . | |
| - name: Generate SBOM for local Docker image | |
| run: | | |
| cdxgen -t docker -o sbom.json -r herodevs/eol-scan:local | |
| - name: Verify SBOM exists | |
| run: ls -l sbom.json | |
| - name: Upload SBOM artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cdxgen-sbom-json | |
| path: sbom.json | |
| scan-sbom: | |
| name: Run HD Scan | |
| runs-on: ubuntu-latest | |
| needs: build-and-sbom | |
| steps: | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Download SBOM artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: cdxgen-sbom-json | |
| path: . | |
| - name: Run EOL scan | |
| run: | | |
| npx @herodevs/cli@beta scan eol --file=sbom.json | |
| - name: Upload HD report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: herodevs-report | |
| path: ./herodevs.report.json |