diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 937eaad8..c6bd37ea 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -38,7 +38,23 @@ on: required: true jobs: + check-secret: + name: check if QUAYIO_REGISTRY_USERNAME & QUAYIO_REGISTRY_PASSWORD is set in github secrets + runs-on: ubuntu-latest + outputs: + is-secret-set: ${{ steps.check-secret-set.outputs.is-secret-set }} + steps: + - name: Check whether unity activation requests should be done + id: check-secret-set + env: + QUAYIO_REGISTRY_USERNAME: ${{ secrets.QUAYIO_REGISTRY_USERNAME }} + QUAYIO_REGISTRY_PASSWORD: ${{ secrets.QUAYIO_REGISTRY_PASSWORD }} + run: | + echo "::set-output name=is-secret-set::${{ env.QUAYIO_REGISTRY_USERNAME != '' && env.QUAYIO_REGISTRY_PASSWORD != '' }}" + build-image: + needs: [check-secret] + if: needs.check-secret.outputs.is-secret-set == 'true' name: Build image and upload to registry runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 81ff1e73..2c114323 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -78,7 +78,6 @@ jobs: asset_content_type: application/octet-stream publish-image: - if: ${{ github.repository == 'kubescape/kubescape' }} # TODO uses: ./.github/workflows/build-image.yaml needs: create-release with: diff --git a/.github/workflows/build_dev.yaml b/.github/workflows/build_dev.yaml index 18f50154..3d57d461 100644 --- a/.github/workflows/build_dev.yaml +++ b/.github/workflows/build_dev.yaml @@ -14,7 +14,6 @@ jobs: client: test publish-dev-image: - if: ${{ github.repository == 'kubescape/kubescape' }} # TODO uses: ./.github/workflows/build-image.yaml needs: test with: