Merge pull request #46 from OpenVoxProject/modulesync #77
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
| --- | |
| # Managed by modulesync - DO NOT EDIT | |
| # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ | |
| name: 🕵️ Security Scanning | |
| # yamllint disable-line rule:truthy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: security-scanning-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| setup-matrix: | |
| name: Set up build matrix | |
| runs-on: ubuntu-latest | |
| outputs: | |
| build-matrix: ${{ steps.build-matrix.outputs.build-matrix }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install yq | |
| uses: dcarbone/install-yq-action@4075b4dca348d74bd83f2bf82d30f25d7c54539b # v1.3.1 | |
| - name: Generate build matrix | |
| id: build-matrix | |
| run: echo "build-matrix=$(yq -o=json build_platforms.yaml | jq -c)" >> "$GITHUB_OUTPUT" | |
| scan-container: | |
| name: Scan ${{ matrix.platform }} container | |
| runs-on: ${{ matrix.runner }} | |
| needs: | |
| - setup-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.setup-matrix.outputs.build-matrix) }} | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Build image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| file: Containerfile | |
| tags: 'ci/openbolt:${{ matrix.platform }}' | |
| load: true | |
| push: false | |
| platforms: linux/${{ matrix.platform }} | |
| - name: Scan image with Anchore Grype | |
| id: scan | |
| uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0 | |
| with: | |
| image: 'ci/openbolt:${{ matrix.platform }}' | |
| fail-build: false | |
| - name: Inspect SARIF report | |
| run: jq . "${{ steps.scan.outputs.sarif }}" | |
| - name: Upload SARIF report | |
| uses: github/codeql-action/upload-sarif@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9 | |
| with: | |
| sarif_file: ${{ steps.scan.outputs.sarif }} | |
| category: 'grype-${{ matrix.platform }}' |