name: "Snyk"

on:
  schedule:
    - cron: "0 0 * * *"

env:
  DEFAULT_JDK_VERSION: 11

jobs:
  quarkus:
    name: Quarkus
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - uses: actions/setup-java@v2
        with:
          java-version: ${{ env.DEFAULT_JDK_VERSION }}
          distribution: zulu
          cache: maven
      
      - name: Build Quarkus
        run: mvn -pl quarkus/dist -am -DskipTests clean install

      - uses: snyk/actions/setup@master
      - name: Check for vulnerabilities
        run: snyk test --policy-path=.snyk --all-projects --prune-repeated-subdependencies --exclude=tests --sarif-file-output=quarkus-report.sarif quarkus
        continue-on-error: true
        env:
          SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

      - name: Upload scanner results to GitHub
        uses: github/codeql-action/upload-sarif@v1
        with:
          sarif_file: quarkus-report.sarif

  operator:
    name: Operator
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - uses: actions/setup-java@v2
        with:
          java-version: ${{ env.DEFAULT_JDK_VERSION }}
          distribution: zulu
          cache: maven
      
      - name: Build Keycloak
        run: mvn -Poperator -pl operator -am -DskipTests clean install

      - uses: snyk/actions/setup@master    
      - name: Check for vulnerabilities for the Operator
        run: snyk test --policy-path=.snyk --all-projects --prune-repeated-subdependencies --exclude=tests --sarif-file-output=operator-report.sarif operator
        continue-on-error: true
        env:
          SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

      - name: Upload scanner results for the Operator to GitHub
        uses: github/codeql-action/upload-sarif@v1
        with:
          sarif_file: operator-report.sarif

Introduce an additional dependency scanner for Keycloak
Introduce an additional dependency scanner for Keycloak

Resolves #10807

Co-authored-by: Jon Koops <71a28b07480219eb589a573692c9c8a6f4d827c5@gmail.com>
