name: 'SDK: Container Checks' on: push: branches: - 'master' - 'v5.*' pull_request: branches: - 'master' - 'v5.*' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: IMAGE_NAME: prowler jobs: sdk-dockerfile-lint: if: github.repository == 'prowler-cloud/prowler' runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read steps: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Check if Dockerfile changed id: dockerfile-changed uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0 with: files: Dockerfile - name: Lint Dockerfile with Hadolint if: steps.dockerfile-changed.outputs.any_changed == 'true' uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0 with: dockerfile: Dockerfile ignore: DL3013 sdk-container-build-and-scan: if: github.repository == 'prowler-cloud/prowler' runs-on: ${{ matrix.runner }} strategy: matrix: include: - platform: linux/amd64 runner: ubuntu-latest arch: amd64 - platform: linux/arm64 runner: ubuntu-24.04-arm arch: arm64 timeout-minutes: 30 permissions: contents: read security-events: write pull-requests: write steps: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Check for SDK changes id: check-changes uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0 with: files: ./** files_ignore: | .github/** prowler/CHANGELOG.md docs/** permissions/** api/** ui/** dashboard/** mcp_server/** README.md mkdocs.yml .backportrc.json .env docker-compose* examples/** .gitignore contrib/** - name: Set up Docker Buildx if: steps.check-changes.outputs.any_changed == 'true' uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 - name: Build SDK container for ${{ matrix.arch }} if: steps.check-changes.outputs.any_changed == 'true' uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 with: context: . push: false load: true platforms: ${{ matrix.platform }} tags: ${{ env.IMAGE_NAME }}:${{ github.sha }}-${{ matrix.arch }} cache-from: type=gha,scope=${{ matrix.arch }} cache-to: type=gha,mode=max,scope=${{ matrix.arch }} - name: Scan SDK container with Trivy for ${{ matrix.arch }} if: steps.check-changes.outputs.any_changed == 'true' uses: ./.github/actions/trivy-scan with: image-name: ${{ env.IMAGE_NAME }} image-tag: ${{ github.sha }}-${{ matrix.arch }} fail-on-critical: 'false' severity: 'CRITICAL'