|
9 | 9 | branches: |
10 | 10 | - main |
11 | 11 |
|
| 12 | +concurrency: |
| 13 | + group: security-scanning-${{ github.event.pull_request.number || github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: read # minimal required permissions to clone repo |
| 18 | + |
12 | 19 | jobs: |
13 | 20 | setup-matrix: |
14 | 21 | runs-on: ubuntu-latest |
15 | 22 | outputs: |
16 | | - matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 23 | + build_matrix: ${{ steps.set-build-matrix.outputs.build_matrix }} |
17 | 24 | steps: |
18 | 25 | - name: Source checkout |
19 | 26 | uses: actions/checkout@v6 |
20 | 27 |
|
21 | 28 | - name: 'Setup yq' |
22 | 29 | uses: dcarbone/install-yq-action@v1.3.1 |
23 | 30 |
|
24 | | - - id: set-matrix |
25 | | - run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT |
| 31 | + - id: set-build-matrix |
| 32 | + run: echo "build_matrix=$(bash matrix.sh build)" >> $GITHUB_OUTPUT |
26 | 33 |
|
27 | 34 | scan_ci_container: |
28 | | - name: 'Scan CI container' |
29 | | - runs-on: ubuntu-latest |
| 35 | + name: 'Scan ${{ matrix.platform }} CI container' |
| 36 | + runs-on: ${{ matrix.runner }} |
30 | 37 | permissions: |
31 | 38 | actions: read |
32 | 39 | contents: read |
33 | 40 | security-events: write |
34 | 41 | needs: setup-matrix |
35 | 42 | strategy: |
36 | | - matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} |
| 43 | + fail-fast: false |
| 44 | + matrix: ${{ fromJson(needs.setup-matrix.outputs.build_matrix) }} |
37 | 45 | steps: |
38 | 46 | - name: Checkout repository |
39 | 47 | uses: actions/checkout@v6 |
40 | 48 |
|
41 | | - - name: Extract version number |
42 | | - id: extract_version |
43 | | - uses: actions/github-script@v9 |
44 | | - with: |
45 | | - script: | |
46 | | - const agentVersion = '${{ matrix.agent_version }}'; |
47 | | - const version = agentVersion.split('-')[0]; |
48 | | - core.setOutput('version', version); |
49 | | -
|
50 | | - - name: Build CI container |
| 49 | + - name: Build ${{ matrix.platform }} CI container |
51 | 50 | uses: docker/build-push-action@v7 |
52 | 51 | with: |
53 | | - tags: 'ci/openvoxagent:${{ steps.extract_version.outputs.version }}' |
| 52 | + tags: ci/openvoxagent:${{ matrix.agent_semver }}-${{ matrix.platform }} |
54 | 53 | context: . |
55 | 54 | file: Containerfile |
| 55 | + load: true |
56 | 56 | push: false |
| 57 | + platforms: linux/${{ matrix.platform }} |
57 | 58 | build-args: | |
58 | 59 | OPENVOX_RELEASE=${{ matrix.release }} |
59 | 60 | OPENVOXAGENT_VERSION=${{ matrix.agent_version }} |
|
62 | 63 | uses: anchore/scan-action@v7 |
63 | 64 | id: scan |
64 | 65 | with: |
65 | | - image: 'ci/openvoxagent:${{ steps.extract_version.outputs.version }}' |
| 66 | + image: 'ci/openvoxagent:${{ matrix.agent_semver }}-${{ matrix.platform }}' |
66 | 67 | fail-build: false |
67 | 68 |
|
68 | 69 | - name: Inspect action SARIF report |
|
72 | 73 | uses: github/codeql-action/upload-sarif@v4 |
73 | 74 | with: |
74 | 75 | sarif_file: ${{ steps.scan.outputs.sarif }} |
| 76 | + category: grype-${{ matrix.platform }} |
0 commit comments