Created
January 8, 2025 18:09
-
-
Save azizur/5253948a72c7cc2bea34a5de33b1bc7c to your computer and use it in GitHub Desktop.
Snyk Gradle Action Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/gradle-security.yaml | |
name: Security - Snyk | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4 | |
- name: Setup Java V21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
build-scan-publish: false | |
- name: Run Snyk to check for vulnerabilities | |
uses: snyk/actions/gradle@master | |
continue-on-error: true | |
env: | |
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
with: | |
args: --severity-threshold=high | |
- name: Run check | |
run: gradle check | |
- name: Store test reports | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-reports | |
path: | | |
**/build/reports/ | |
**/build/test-results/ | |
retention-days: 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment