name: build-image
permissions: read-all
on:
    workflow_dispatch:
      inputs:
        CLIENT:
          required: false
          type: string
          default: "test"
        IMAGE_TAG:
          required: true
          type: string
        CO_SIGN:
          type: boolean
          required: false
          default: false
        PLATFORMS:
            type: boolean
            required: false
            default: false
jobs:
  build-http-image:
    permissions:
      id-token: write
      packages: write
      contents: write
      pull-requests: read
    uses: kubescape/workflows/.github/workflows/incluster-comp-pr-merged.yaml@main
    with:
      IMAGE_NAME: quay.io/${{ github.repository_owner }}/kubescape
      IMAGE_TAG: ${{ inputs.IMAGE_TAG }}
      COMPONENT_NAME: kubescape
      CGO_ENABLED: 0
      GO111MODULE: "on"
      BUILD_PLATFORM: ${{ inputs.PLATFORMS && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
      GO_VERSION: "1.21"
      REQUIRED_TESTS: '[]'
      COSIGN: ${{ inputs.CO_SIGN }}
      HELM_E2E_TEST: false
      FORCE: true
    secrets: inherit
