name: Scheduled 5.0.z Vulnerability Scan

# Since scheduled workflows run on the latest
# commit on the default or base branch, this
# backport job is scheduled not on 5.0.z branch
# but master.
on:
  schedule:
    - cron: '0 2 * * *'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code at 5.0.z branch
        uses: actions/checkout@v2
        with:
          ref: 5.0.z

      - name: Build OSS image
        run: |
          docker build -t hazelcast/oss:${{ github.sha }} hazelcast-oss
      - name: Build EE image
        run: |
          docker build -t hazelcast/ee:${{ github.sha }} hazelcast-enterprise

      - name: Scan OSS image by Azure (Trivy + Dockle)
        if: always()
        uses: Azure/container-scan@v0
        with:
          image-name: hazelcast/oss:${{ github.sha }}
          severity-threshold: MEDIUM

      - name: Scan OSS image by Snyk
        if: always()
        uses: snyk/actions/docker@master
        env:
          SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
        with:
          image: hazelcast/oss:${{ github.sha }}
          args: --file=hazelcast-oss/Dockerfile --policy-path=.github/containerscan --severity-threshold=medium

      - name: Scan EE image by Azure (Trivy + Dockle)
        if: always()
        uses: Azure/container-scan@v0
        with:
          image-name: hazelcast/ee:${{ github.sha }}
          severity-threshold: MEDIUM

      - name: Scan EE image by Snyk
        if: always()
        uses: snyk/actions/docker@master
        env:
          SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
        with:
          image: hazelcast/ee:${{ github.sha }}
          args: --file=hazelcast-enterprise/Dockerfile --policy-path=.github/containerscan --severity-threshold=medium

Add 5.0.z backport vulnerability scan workflow
Add 5.0.z backport vulnerability scan workflow
