diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 67c86c0d..d64b2dd4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,12 +50,28 @@ jobs: name: 'Built test Docker image' runs-on: ubuntu-latest permissions: + actions: read contents: read + security-events: write steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Build Docker image uses: docker/build-push-action@v4 with: context: . + tags: 'ci/hdm:${{ github.sha }}' push: false + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + image-ref: 'ci/hdm:${{ github.sha }}' + format: 'sarif' + output: 'trivy-results.sarif' + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: 'trivy-results.sarif'