Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Leverage DataStax's Snyk version as opposed to OSS version #182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 38 additions & 6 deletions .github/workflows/snyk-cli-scan.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
# GitHub action CI
# trigger by:
# any push on any protected branch: main, v6.8, releases/**
# any PR crteated against any protected branch: main, v6.8, releases/**
name: 🔬 Snyk cli SCA

on:
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

env:
SNYK_SEVERITY_THRESHOLD_LEVEL: critical
SNYK_SEVERITY_THRESHOLD_LEVEL: high

jobs:
snyk-cli-scan:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3

- name: prepare for snyk scan
uses: datastax/shared-github-actions/actions/snyk-prepare@main

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
cache: maven

- name: run maven install prepare for snyk
run: |
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
- name: snyk scan java
uses: datastax/shared-github-actions/actions/snyk-scan-java@main
with:
directories: .
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
SNYK_ORG_ID: ${{ secrets.SNYK_ORG_ID }}
extra-snyk-options: "-DskipTests -Dmaven.javadoc.skip=true"

- name: Snyk scan result
uses: datastax/shared-github-actions/actions/snyk-process-scan-results@main
with:
gh_repo_token: ${{ secrets.GITHUB_TOKEN }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
SNYK_ORG_ID: ${{ secrets.SNYK_ORG_ID }}
11 changes: 8 additions & 3 deletions .github/workflows/snyk-pr-cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# GitHub Action CI
# Snyk clean-up when PR is merged/closed
name: 🗑️ Snyk PR cleanup - merged/closed

on:
pull_request:
types:
- closed
branches:
branches:
- main
workflow_dispatch:

jobs:
snyk_project_cleanup_when_pr_closed:
uses: datastax/shared-github-actions/.github/workflows/snyk-pr-cleanup.yml@main
secrets:
snyk_token: ${{ secrets.SNYK_TOKEN }}
snyk_org_id: ${{ secrets.SNYK_ORG_ID }}