Skip to content

Commit

Permalink
Create Snyk_Scan.yml (#1452)
Browse files Browse the repository at this point in the history
created a snyk scan workflow to be run on a weekly schedule or to be triggered manually
  • Loading branch information
deleonenriqueta authored Aug 14, 2023
1 parent 258edd7 commit 566ce65
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/Snyk_Scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This workflow automates the process of identifying potential security vulnerabilities
# in the agent's dependencies using Snyk. Vulnerability scans will be run on a
# weekly schedule, but can also be triggered manually.
name: Snyk Vulnerability Scan

on:
workflow_dispatch:
schedule:
- cron: '00 15 * * 1'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Java agent
uses: actions/checkout@v3
with:
ref: 'main'

- name: Set Up Javas
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: |
17
11
8
- name: Set gradle.properties
shell: bash
run: |
sed -i -e "s|jdk8=8|jdk8=${JAVA_HOME_8_X64}|
s|jdk11=11|jdk11=${JAVA_HOME_11_X64}|
s|jdk17=17|jdk17=${JAVA_HOME_17_X64}|" gradle.properties.gha
cat gradle.properties.gha >> gradle.properties
- name: Set Gradle Options
run: |
echo "GRADLE_OPTIONS=-Porg.gradle.java.installations.auto-detect=false" \
"-Porg.gradle.java.installations.fromEnv=JAVA_HOME_17_x64,JAVA_HOME_11_x64,JAVA_HOME_8_x64" \
>> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build Agent
run: ./gradlew $GRADLE_OPTIONS jar

security:
runs-on: ubuntu-latest
steps:
- name: Checkout Java Agent
uses: actions/checkout@master

- name: Run Snyk To Check For Vulnerabilities
uses: snyk/actions/gradle@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
args: --all-sub-projects --org=java-agent --configuration-matching='(^compileClasspath$)|(^runtimeClasspath$)'

0 comments on commit 566ce65

Please sign in to comment.