name: scan on: push: branches: [ main ] pull_request: branches: [ main ] schedule: - cron: '18 10 * * 3' permissions: contents: read # for actions/checkout to fetch code security-events: write # for codeQL to write security events jobs: fossa: name: FOSSA runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Run FOSSA scan and upload build data uses: fossa-contrib/fossa-action@v1 with: # FOSSA Push-Only API Token fossa-api-key: 5ee8bf422db1471e0bcf2bcb289185de github-token: ${{ github.token }} snyk: name: Snyk runs-on: ubuntu-latest if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository steps: - uses: actions/checkout@v3 - name: Setup Kustomize uses: fluxcd/pkg//actions/kustomize@main - name: Build manifests run: | make cmd/flux/.manifests.done - name: Run Snyk to check for vulnerabilities uses: snyk/actions/golang@master continue-on-error: true env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} with: args: --sarif-file-output=snyk.sarif - name: Upload result to GitHub Code Scanning uses: github/codeql-action/upload-sarif@v1 with: sarif_file: snyk.sarif codeql: name: CodeQL runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Set up Go uses: actions/setup-go@v2 with: go-version: 1.19.x - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: languages: go - name: Autobuild uses: github/codeql-action/autobuild@v2 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2