|
| 1 | +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven |
| 3 | + |
| 4 | +# This workflow uses actions that are not certified by GitHub. |
| 5 | +# They are provided by a third-party and are governed by |
| 6 | +# separate terms of service, privacy policy, and support |
| 7 | +# documentation. |
| 8 | + |
| 9 | +name: Java CI with Maven |
| 10 | + |
| 11 | +on: |
| 12 | + push: |
| 13 | + branches: [ "master" ] |
| 14 | + pull_request: |
| 15 | + branches: [ "master" ] |
| 16 | + |
| 17 | +jobs: |
| 18 | + build: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + - name: Set up JDK 17 |
| 23 | + uses: actions/setup-java@v4 |
| 24 | + with: |
| 25 | + java-version: '17' |
| 26 | + distribution: 'temurin' |
| 27 | + cache: maven |
| 28 | + - name: Build with Maven |
| 29 | + run: mvn -B package --file pom.xml |
| 30 | + |
| 31 | + semgrep: |
| 32 | + #User definable name of this GitHub Actions Job. |
| 33 | + name: semgrep/ci |
| 34 | + #If you are self-hosting, change the following 'runs-on' value: |
| 35 | + runs-on: ubuntu latest |
| 36 | + container: |
| 37 | + # A Docker image with Sengrep installed. Do not change this. |
| 38 | + image: semgrep/semgrep |
| 39 | + steps: |
| 40 | + # Fetch project source with GitHub Actions Checkout. Use either v3 or v4. |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + # Run the "semgrep ci" command line on the docker image. |
| 43 | + - run: semgrep ci --sarif>semgrep.sarif |
| 44 | + env: |
| 45 | + # Connect to Sengrep AppSec Platfrom through your SEMGREP_APP_TOKEN |
| 46 | + # Generate a token from Semgrep AppSec Platform > Settings |
| 47 | + # and add it to your GitHub secrets. |
| 48 | + SENGREP_APP_TOKEN: "a6fe38d1ee947f374c8f2beef5f6226431784539fff4c506cefc890571a88b88" |
| 49 | + uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 |
0 commit comments